]> git.tdb.fi Git - libs/net.git/commitdiff
Pass an exception to signal_connect_finished
authorMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 21:02:13 +0000 (00:02 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 6 Aug 2011 21:02:13 +0000 (00:02 +0300)
source/clientsocket.h
source/streamsocket.cpp

index c81e4cd530ba1317e6f576bdfb914e36b1b9976b..db684f4a5d32dc99ae873379eccc58eaea2df15a 100644 (file)
@@ -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<void, int> signal_connect_finished;
+       /** Emitted when the socket finishes connecting. */
+       sigc::signal<void, const std::exception *> signal_connect_finished;
 
 protected:
        bool connecting;
index 7ede11552aeba1326928e8e845b0eabe23544c6a..7919ec4d01d348c6fa1d6955588d4d84bdd26ac8 100644 (file)
@@ -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)
                {