comparison include/UdpClient.h @ 135:e77e2e712fbc ClockSync

To work with the ClockSync plugin
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 12 Sep 2015 20:05:55 +0100
parents da1c61aa97ea
children
comparison
equal deleted inserted replaced
133:04b1678614c9 135:e77e2e712fbc
21 class UdpClient{ 21 class UdpClient{
22 private: 22 private:
23 int port; 23 int port;
24 int enabled; 24 int enabled;
25 int outSocket; 25 int outSocket;
26 struct timeval stTimeOut;
27 fd_set stWriteFDS;
26 bool isSetPort; 28 bool isSetPort;
27 bool isSetServer; 29 bool isSetServer;
28 struct sockaddr_in destinationServer; 30 struct sockaddr_in destinationServer;
29 public: 31 public:
30 UdpClient(); 32 UdpClient();
32 ~UdpClient(); 34 ~UdpClient();
33 void setPort(int aPort); 35 void setPort(int aPort);
34 void setServer(const char* aServerName); 36 void setServer(const char* aServerName);
35 int send(void* message, int size); 37 int send(void* message, int size);
36 int write(const char* remoteHostname, int remotePortNumber, void* sourceBuffer, int numBytesToWrite); 38 int write(const char* remoteHostname, int remotePortNumber, void* sourceBuffer, int numBytesToWrite);
39 int waitUntilReady(bool readyForReading, int timeoutMsecs);
37 }; 40 };
38 41
39 42
40 43
41 #endif /* UDPCLIENT_H_ */ 44 #endif /* UDPCLIENT_H_ */