Issue 13: Added support for connect sequence timeout

Decreased the select timeout when reading headers
Don't call callback with DISCONNECTED if the connection was never connected
This commit is contained in:
JCash
2020-10-17 11:40:53 +02:00
parent 9d1ace0a82
commit e105702c79
4 changed files with 43 additions and 8 deletions

View File

@@ -105,13 +105,13 @@ Result ReceiveHeaders(WebsocketConnection* conn)
dmSocket::SelectorZero(&selector);
dmSocket::SelectorSet(&selector, dmSocket::SELECTOR_KIND_READ, conn->m_Socket);
dmSocket::Result sr = dmSocket::Select(&selector, 200*1000);
dmSocket::Result sr = dmSocket::Select(&selector, SOCKET_WAIT_TIMEOUT);
if (dmSocket::RESULT_OK != sr)
{
if (dmSocket::RESULT_WOULDBLOCK)
{
dmLogWarning("Waiting for socket to be available for reading");
DebugLog(1, "Waiting for socket to be available for reading");
return RESULT_WOULDBLOCK;
}