This commit is contained in:
Alexandre Konieczny 2019-04-24 17:53:11 +02:00
parent 1f518aa95d
commit 2b9b31ef4c
4 changed files with 10 additions and 11 deletions

View File

@ -272,8 +272,6 @@ namespace ix
// 2. Poll to see if there's any new data available // 2. Poll to see if there's any new data available
WebSocketTransport::PollPostTreatment pollPostTreatment = _ws.poll(); WebSocketTransport::PollPostTreatment pollPostTreatment = _ws.poll();
//if (_stop) return;
// 3. Dispatch the incoming messages // 3. Dispatch the incoming messages
_ws.dispatch( _ws.dispatch(
pollPostTreatment, pollPostTreatment,

View File

@ -43,7 +43,7 @@ namespace ix
client->close(); client->close();
} }
//SocketServer::stop(); SocketServer::stop();
} }
void WebSocketServer::enablePong() void WebSocketServer::enablePong()

View File

@ -333,7 +333,7 @@ namespace ix
_socket->close(); _socket->close();
} }
if (_readyState == CLOSING && closingDelayExceeded()) if (_readyState == CLOSING /*&& closingDelayExceeded()*/)
{ {
// close code and reason were set when calling close() // close code and reason were set when calling close()
_socket->close(); _socket->close();
@ -928,8 +928,6 @@ namespace ix
sendCloseFrame(code, reason); sendCloseFrame(code, reason);
setReadyState(CLOSING);
{ {
std::lock_guard<std::mutex> lock(_closeDataMutex); std::lock_guard<std::mutex> lock(_closeDataMutex);
_closeCode = code; _closeCode = code;
@ -941,6 +939,9 @@ namespace ix
std::lock_guard<std::mutex> lock(_closingTimePointMutex); std::lock_guard<std::mutex> lock(_closingTimePointMutex);
_closingTimePoint = std::chrono::steady_clock::now(); _closingTimePoint = std::chrono::steady_clock::now();
} }
setReadyState(CLOSING);
_socket->wakeUpFromPoll(Socket::kSendRequest);
} }
size_t WebSocketTransport::bufferedAmount() const size_t WebSocketTransport::bufferedAmount() const

View File

@ -35,12 +35,12 @@ set (SOURCES
# Some unittest don't work on windows yet # Some unittest don't work on windows yet
if (NOT WIN32) if (NOT WIN32)
list(APPEND SOURCES list(APPEND SOURCES
#IXWebSocketCloseTest.cpp IXWebSocketCloseTest.cpp
IXWebSocketServerTest.cpp IXWebSocketServerTest.cpp
#IXWebSocketPingTest.cpp IXWebSocketPingTest.cpp
#IXWebSocketPingTimeoutTest.cpp IXWebSocketPingTimeoutTest.cpp
#cmd_websocket_chat.cpp cmd_websocket_chat.cpp
#IXWebSocketTestConnectionDisconnection.cpp IXWebSocketTestConnectionDisconnection.cpp
) )
endif() endif()