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).
This commit is contained in:
Robin Burchell 2019-07-16 12:38:09 +02:00 committed by Andreas Kling
parent 41d2c674d7
commit 14b2f90920
Notes: sideshowbarker 2024-07-19 13:14:57 +09:00

View File

@ -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;
}