Handle initial connect failure better.

This commit is contained in:
Chris Marsh 2017-07-25 11:41:12 -07:00
parent fbd8d6897d
commit 7c07dba3f7

View file

@ -69,7 +69,7 @@ void RpcConnection::Open()
void RpcConnection::Close()
{
if (onDisconnect && state == State::Connected) {
if (onDisconnect && (state == State::Connected || state == State::SentHandshake)) {
onDisconnect(lastErrorCode, lastErrorMessage);
}
connection->Close();