61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
/*
|
|
* File: ServerAutoDetetc_Client.h
|
|
* Author: Hagi
|
|
*
|
|
* Created on 16. April 2019, 08:57
|
|
*/
|
|
#ifndef SERVERAUTODETETC_CLIENT_H
|
|
#define SERVERAUTODETETC_CLIENT_H
|
|
#include "_SPITMACROS.h"
|
|
#include "SPIT_Handler.h"
|
|
#include "SPITSocket.h"
|
|
#include "SAD_DetectedServer.h"
|
|
#include <string>
|
|
#include <list>
|
|
#include "Mutex.hpp"
|
|
#include "Semaphore.hpp"
|
|
#include "Task.hpp"
|
|
|
|
|
|
static const string SERVERAUTODETECT_PRECODE = "#SAD#";
|
|
static const string SERVERAUTODETECT_SEPERATOR = "#,#";
|
|
static const string SERVERAUTODETECT_TASKID = "#spit#";
|
|
static const string SERVERAUTODETECT_PORT = "15110";
|
|
|
|
class SAD_Client {
|
|
|
|
//----- SAD Client Interface ------
|
|
private:
|
|
static SAD_ClientInterface* s_SADClientInterface;
|
|
|
|
//----- SAD_Client -----
|
|
public:
|
|
private:
|
|
static fos::Mutex s_MutexSAD;
|
|
static fos::Semaphore s_ConditionStopSAD;
|
|
static bool s_StopSAD;
|
|
static fos::Task* s_ThreadSend;
|
|
static fos::Task* s_ThreadReceiveIP4;
|
|
|
|
static fos::Mutex s_MutexSocket;
|
|
static SPITSocket* s_SPITSocket;
|
|
|
|
static void cycleStart();
|
|
static void cycleEnd();
|
|
static void sendAutoDetectServer();
|
|
static void receiveAutoDetectServer_IP4();
|
|
|
|
public:
|
|
static void startAutoDetectServer(SAD_ClientInterface* p_SADClientInterface, SPITSocket* p_SPITSocket);
|
|
static void stopAutoDetectServer(SAD_ClientInterface* p_SADClientInterface);
|
|
};
|
|
|
|
#endif /* SERVERAUTODETETC_CLIENT_H */
|
|
|