diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-07-16 12:38:09 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-16 13:18:37 +0200 |
commit | 14b2f9092027b47f665e1e6a87998967b8001efb (patch) | |
tree | 36b1eb0439e39acc8de68e061cb6957b6bac6a9d | |
parent | 41d2c674d764314c2930bcf4bfcf2992bf6b5cb8 (diff) | |
download | serenity-14b2f9092027b47f665e1e6a87998967b8001efb.zip |
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).
-rw-r--r-- | Libraries/LibCore/CSocket.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Libraries/LibCore/CSocket.cpp b/Libraries/LibCore/CSocket.cpp index b0ca5df109..ff424ea7a7 100644 --- a/Libraries/LibCore/CSocket.cpp +++ b/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; } |