diff options
Diffstat (limited to 'src/Net/Connection.cpp')
-rw-r--r-- | src/Net/Connection.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index fc917d4..94b5493 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -44,17 +44,20 @@ void Connection::handleHandshake(const boost::system::error_code& error) { { boost::lock_guard<boost::shared_mutex> lock(connectionLock); - _setState(CONNECTED); + _setState(CONNECT); receiving = false; sending = 0; received = 0; - } - connectedSignal.emit(); + connectedSignal.emit(); - enterReceiveLoop(); + if(dontStart) + return; + } + + startReceive(); } void Connection::handleShutdown(const boost::system::error_code& error) { @@ -73,7 +76,7 @@ void Connection::enterReceiveLoop() { { boost::lock_guard<boost::shared_mutex> lock(connectionLock); - if(!_isConnected() || _isDisconnecting()) + if(state != CONNECTED) return; } |