http: improve socket closure, keepalive
This commit is contained in:
parent
810c6c913e
commit
15b1aaf83b
1 changed files with 4 additions and 6 deletions
|
@ -168,14 +168,12 @@ public sealed class HttpServer
|
||||||
//Create and run websocket
|
//Create and run websocket
|
||||||
WebsocketRemote ws = new WebsocketRemote(req, clientInfo, httpStream, swp.Fields.WebSocketProtocol);
|
WebsocketRemote ws = new WebsocketRemote(req, clientInfo, httpStream, swp.Fields.WebSocketProtocol);
|
||||||
CloseStatus closeStatus = await swp.Callback(ws);
|
CloseStatus closeStatus = await swp.Callback(ws);
|
||||||
ws.Close(closeStatus);
|
await ws.Close(closeStatus).WaitAsync(Timeout);
|
||||||
break; //Close
|
break; //Close
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if (req.Fields.Connection == ConnectionType.Close)
|
||||||
if (response.StatusCode is not >= 200 or not < 300 || (req.Fields.Connection == ConnectionType.Close))
|
break; //Close
|
||||||
break; //Close
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (HttpException e)
|
catch (HttpException e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue