Przeglądaj źródła

LibCore: Always call on_connected whether the connection was synchronous or not

It's unreasonable to expect the client to have to call it themselves if
the connection was immediate (local).
Robin Burchell 6 lat temu
rodzic
commit
14b2f90920
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      Libraries/LibCore/CSocket.cpp

+ 5 - 2
Libraries/LibCore/CSocket.cpp

@@ -66,9 +66,12 @@ bool CSocket::connect(const CSocketAddress& address, int port)
         }
         perror("connect");
         exit(1);
+    } else {
+        dbg() << *this << " connected ok!";
+        m_connected = true;
+        if (on_connected)
+            on_connected();
     }
-    dbg() << *this << " connected ok!";
-    m_connected = true;
     return true;
 }