Mercurial > hg > beaglert
view include/UdpClient.h @ 312:00725dfc1b87 prerelease
Decrufting: removed ancient DBOX_CAPE define from header files (not yet from PRU code)
author | andrewm |
---|---|
date | Fri, 27 May 2016 18:42:28 +0100 |
parents | c42a6b4dc2d4 |
children | 6599a9978ac4 |
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; struct timeval stTimeOut; fd_set stWriteFDS; 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); int waitUntilReady(bool readyForReading, int timeoutMsecs); }; #endif /* UDPCLIENT_H_ */