Mercurial > hg > beaglert
view include/UdpClient.h @ 133:04b1678614c9 scope-refactoring
Using moving average for clock detection during synchronization seems to be working better but audio gets worse and worse
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Thu, 27 Aug 2015 03:33:32 +0100 |
parents | da1c61aa97ea |
children | e77e2e712fbc |
line wrap: on
line source
/* * udpClient.h * * Created on: 19 May 2015 * Author: giulio moro */ #ifndef UDPCLIENT_H_ #define UDPCLIENT_H_ #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> class UdpClient{ private: int port; int enabled; int outSocket; bool isSetPort; bool isSetServer; struct sockaddr_in destinationServer; public: UdpClient(); UdpClient(int aPort, const char* aServerName); ~UdpClient(); void setPort(int aPort); void setServer(const char* aServerName); int send(void* message, int size); int write(const char* remoteHostname, int remotePortNumber, void* sourceBuffer, int numBytesToWrite); }; #endif /* UDPCLIENT_H_ */