Mercurial > hg > beaglert
comparison include/UdpClient.h @ 44:f5b5c648cd5d ultra-staging
- added (unused) simple c++ classes for udp datagrams\n- added tests for the new classes
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Wed, 20 May 2015 18:07:16 +0100 |
parents | |
children | 6907e2177eb8 |
comparison
equal
deleted
inserted
replaced
42:24af9a14b203 | 44:f5b5c648cd5d |
---|---|
1 /* | |
2 * udpClient.h | |
3 * | |
4 * Created on: 19 May 2015 | |
5 * Author: giulio moro | |
6 */ | |
7 | |
8 #ifndef UDPCLIENT_H_ | |
9 #define UDPCLIENT_H_ | |
10 | |
11 #include <sys/types.h> | |
12 #include <sys/socket.h> | |
13 #include <netinet/in.h> | |
14 #include <arpa/inet.h> | |
15 #include <netdb.h> | |
16 #include <stdio.h> | |
17 #include <stdlib.h> | |
18 #include <unistd.h> | |
19 #include <string.h> | |
20 | |
21 class UdpClient{ | |
22 private: | |
23 int port; | |
24 int enabled; | |
25 int outSocket; | |
26 struct sockaddr_in destinationServer; | |
27 public: | |
28 UdpClient(); | |
29 UdpClient(int aPort, const char* aServerName); | |
30 ~UdpClient(); | |
31 void setPort(int aPort); | |
32 void setServer(const char* aServerName); | |
33 int send(void* message, int size); | |
34 }; | |
35 | |
36 | |
37 | |
38 #endif /* UDPCLIENT_H_ */ |