mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 05:23:13 +00:00
await
This commit is contained in:
@ -18,7 +18,8 @@ namespace Esiur.AspNetCore
|
||||
{
|
||||
var buffer = new ArraySegment<byte>(new byte[10240]);
|
||||
|
||||
if (context.WebSockets.IsWebSocketRequest)
|
||||
if (context.WebSockets.IsWebSocketRequest
|
||||
&& context.WebSockets.WebSocketRequestedProtocols.Contains("iip"))
|
||||
{
|
||||
var webSocket = await context.WebSockets.AcceptWebSocketAsync("iip");
|
||||
var socket = new FrameworkWebSocket(webSocket);
|
||||
@ -27,7 +28,9 @@ namespace Esiur.AspNetCore
|
||||
iipConnection.Assign(socket);
|
||||
socket.Begin();
|
||||
|
||||
while (webSocket.State == WebSocketState.Open) ;
|
||||
// @TODO: Change this
|
||||
while (webSocket.State == WebSocketState.Open)
|
||||
await Task.Delay(500);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user