diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/UdpClient.h	Wed May 20 18:07:16 2015 +0100
@@ -0,0 +1,38 @@
+/*
+ * 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 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);
+};
+
+
+
+#endif /* UDPCLIENT_H_ */