From: Mikko Rasa Date: Sat, 6 Aug 2011 21:02:13 +0000 (+0300) Subject: Pass an exception to signal_connect_finished X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=446707e0be6f2dfc3c983296b74030b7121a58b8;p=libs%2Fnet.git Pass an exception to signal_connect_finished --- diff --git a/source/clientsocket.h b/source/clientsocket.h index c81e4cd..db684f4 100644 --- a/source/clientsocket.h +++ b/source/clientsocket.h @@ -12,9 +12,8 @@ ClientSockets are used for sending and receiving data over the network. class ClientSocket: public Socket { public: - /** Emitted when the socket finishes connecting. The argument is a - platform-dependent error code. */ - sigc::signal signal_connect_finished; + /** Emitted when the socket finishes connecting. */ + sigc::signal signal_connect_finished; protected: bool connecting; diff --git a/source/streamsocket.cpp b/source/streamsocket.cpp index 7ede115..7919ec4 100644 --- a/source/streamsocket.cpp +++ b/source/streamsocket.cpp @@ -123,7 +123,13 @@ void StreamSocket::on_event(IO::PollEvent ev) connecting = false; connected = (err==0); - signal_connect_finished.emit(err); + if(err) + { + system_error exc("connect", err); + signal_connect_finished.emit(&exc); + } + else + signal_connect_finished.emit(0); if(err!=0) {