Les dejo aquí mi codigo. Me da errores porque saltan excepciones. Los errores que me dan son:
OverflowError: long int too large to convert to int
RuntimeError: Error reading string from inferior: Error de entrada/salida
int main(int argc, char* argv[])
{
try
{
if (argc != 3)
{
std::cerr << "Usage: client <host> <port>\n";
return 1;
}
using namespace std;
std::string host_name = argv[1];
std::string port = argv[2];
boost::asio::io_service io_service;
Cliente c1= Cliente(host_name,port);
c1.determine_location_server(host_name,port);
c1.establish_connection();
c1.create_datagram();
c1.determine_port();
c1.ask_server();
unsigned long last_frame_number = 0;
for (;;)
{
// Receive 50 messages on the current data socket.
for (int i = 0; i < 50; ++i)
{
// Receive a frame from the server.
frame f;
boost::shared_ptr<udp::socket> data_socket;
data_socket->receive(f.to_buffers(), 0);
if (f.number() > last_frame_number)
{
last_frame_number = f.number();
std::cout << "\n" << f.payload();
}
}
}
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << std::endl;
}
return 1;
}
a ver si alguien puede ayudarme. Muchas gracias