Skip to content

Commit 32f8084

Browse files
authored
Integration for WebsocketServer (#120)
1 parent 61d36c3 commit 32f8084

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

nanoFramework.WebServer/WebServer.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,16 @@ private void StartListener()
593593
context.Response.ContentLength64 = 0;
594594
}
595595

596-
context.Response.Close();
597-
context.Close();
596+
// When context has been handed over to WebsocketServer, it will be null at this point
597+
if (context.Response == null)
598+
{
599+
//do nothing this is a websocket that is managed by a websocketserver that is responsible for the context now.
600+
}
601+
else
602+
{
603+
context.Response.Close();
604+
context.Close();
605+
}
598606
}
599607

600608
if (!isRoute)
@@ -611,7 +619,7 @@ private void StartListener()
611619
}
612620

613621
context.Response.Close();
614-
context.Close();
622+
context.Close();
615623
}
616624
}).Start();
617625

0 commit comments

Comments
 (0)