view include/UdpClient.h @ 53:6907e2177eb8 ultra-staging

Fixed bugs in Udp classes, updated tests
author Giulio Moro <giuliomoro@yahoo.it>
date Sun, 07 Jun 2015 14:58:34 +0100
parents f5b5c648cd5d
children 3068421c0737
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);
};



#endif /* UDPCLIENT_H_ */