From: Mikko Rasa Date: Thu, 17 Jan 2013 14:13:14 +0000 (+0200) Subject: Adapt to mspnet API changes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=64feb0c70888bfc7c11b05dcc71be495f255c039;p=r2c2.git Adapt to mspnet API changes --- diff --git a/source/network/server.cpp b/source/network/server.cpp index c0a6946..d4e2049 100644 --- a/source/network/server.cpp +++ b/source/network/server.cpp @@ -1,4 +1,6 @@ +#include #include +#include #include "libr2c2/driver.h" #include "libr2c2/route.h" #include "libr2c2/train.h" @@ -25,7 +27,8 @@ Server::Server(Layout &l): for(map::const_iterator i=trains.begin(); i!=trains.end(); ++i) train_added(*i->second); - listen_sock.listen(Net::InetAddr(0, 8315), 4); + RefPtr addr = Net::resolve("*", "8315", Net::INET); + listen_sock.listen(*addr, 4); listen_sock.signal_data_available.connect(sigc::mem_fun(this, &Server::incoming_connection)); } @@ -210,7 +213,6 @@ void Server::Connection::handshake_done() void Server::Connection::end_of_file() { - socket->close(); stale = true; } diff --git a/source/network/server.h b/source/network/server.h index 16022ba..febd567 100644 --- a/source/network/server.h +++ b/source/network/server.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "libr2c2/layout.h" #include "libr2c2/trainstatus.h" #include "packets.h" @@ -39,7 +39,7 @@ private: Protocol proto; Layout &layout; - Msp::Net::StreamListenSocket listen_sock; + Msp::Net::StreamServerSocket listen_sock; Msp::IO::EventDispatcher *event_disp; std::vector connections;