Ejemplo de aplicación cliente
#include <iostream>
#include <sstream>
#include <signal.h>
#include <cstdlib>
#include <sys/time.h>
using namespace std;
{
cout << "Server connection terminated unexpectedly" << endl << "Exiting" << endl;
exit(-1);
}
{
string send, recv, host;
int port;
cout << "Created socket" << endl;
cout << "Hostname: ";
cin >> host;
cout << "Port: ";
cin >> port;
cin.ignore();
cout << "Connected" << endl;
while(true)
{
cout << "> ";
getline(cin,send);
s >> recv;
cout << "Received: " << recv << endl;
}
}