Added checking for not reusing a session

This commit is contained in:
sta 2014-04-03 17:51:47 +09:00
parent 0ef002be52
commit 6f5709472d

View File

@ -305,6 +305,13 @@ namespace WebSocketSharp.Server
internal void Start (WebSocketContext context, WebSocketSessionManager sessions)
{
if (_websocket != null) {
_websocket.Log.Error ("This session has already been started.");
context.WebSocket.Close (HttpStatusCode.ServiceUnavailable);
return;
}
_context = context;
_sessions = sessions;