#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#include "SDL/SDL_net.h"
#include <assert.h>

#include "net.cpp"

//class client{
//	UDPsocket sd;
//	IPaddress srvadd;
//	UDPpacket *p;
//	int quit;
//public:
//    client(char * host, char * port);
//    ~client();  
//    bool send(char * msg);
//};
// 
//client::client(char * host, char * port)
//{
//    assert(SDLNet_Init() >= 0);
//    assert((sd = SDLNet_UDP_Open(0)));
//    assert(SDLNet_ResolveHost(&srvadd, host, atoi(port)) != -1);
//    assert((p = SDLNet_AllocPacket(512)));
//}

//client::~client()
//{
//    SDLNet_FreePacket(p);
//    SDLNet_Quit();
//}

//bool client::send(char * msg)
//{
//	printf("Fill the buffer\n>");
//	scanf("%s", (char *)p->data);

//	p->address.host = srvadd.host;	/* Set the destination host */
//	p->address.port = srvadd.port;	/* And destination port */

//	p->len = strlen((char *)p->data) + 1;
//	SDLNet_UDP_Send(sd, -1, p); /* This sets the p->channel */

//	/* Quit if packet contains "quit" */
//	if (!strcmp((char *)p->data, "quit"))
//		quit = 1;
//}
 
int main(int argc, char **argv)
{

 
	/* Check for parameters */
	assert(argc >= 3);
	
    udp cli(argv[1], argv[2]);
    
    cli.send("");
 
	return EXIT_SUCCESS;
}
