X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/989d0da7e93d155dde399bf3047ab6b4af550bb6..a9d033a0a6748c192d30c9c65ebcc8b1a96cd43b:/Server/src/transmitter.cpp diff --git a/Server/src/transmitter.cpp b/Server/src/transmitter.cpp index a195f6f..de940f9 100644 --- a/Server/src/transmitter.cpp +++ b/Server/src/transmitter.cpp @@ -45,15 +45,19 @@ Transmitter::~Transmitter(void) { #endif // DEBUG } -Transmitter::Transmitter(const string& _host, const Connection::Port& _port): - Connection(sockbuf::sock_dgram) { +Transmitter::Transmitter(string& _host, Connection::Port& _port): + Connection(sockbuf::sock_dgram, _host, _port) { #ifdef DEBUG - cerr << __FILE__ << ": host = " << _host - << " | port = " << _port << endl; + cerr << __FILE__ << ": _host = " << _host + << " | _port = " << _port << endl; #endif // DEBUG - socket->connect(_host.c_str(), _port); - host = socket->peerhost(); - port = socket->peerport(); + socket->connect(host.c_str(), port); + // Reasigno el host y puerto bien, tanto de este objeto como los que se + // environ para indicar su valor correcto. + host = socket->peerhost(); + port = socket->peerport(); + _host = socket->peerhost(); + _port = socket->peerport(); } /// \todo debría dar una excepción (?)