#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std;
 
#include "SDL/SDL_net.h"
#include <assert.h>

#include "net.hpp"

int main(int argc, char **argv)
{

    char buffer[512];
	/* Simple parameter checking */
	if (argc < 3)
	{
		fprintf(stderr, "Usage: %s host port\n", argv[0]);
		exit(EXIT_FAILURE);
	}
 

    client cli(argv[1], argv[2]);
	/* Send messages */
    while(1)
    {
        cout << "message:" ;
        cin >> buffer;
        if(cli.send(buffer))
            cout << endl << "return:" << cli.recv() << endl;
    }
 

 
	return EXIT_SUCCESS;
}
