internal string Add(IWebSocketSession session) { string str; object obj = this._sync; Monitor.Enter(obj); try { if (this._state == ServerState.Start) { string str1 = WebSocketSessionManager.createID(); this._sessions.Add(str1, session); str = str1; } else { str = null; } } finally { Monitor.Exit(obj); } return(str); }
internal string Add(IWebSocketSession session) { object sync = this._sync; string result; lock (sync) { if (this._state != ServerState.Start) { result = null; } else { string text = WebSocketSessionManager.createID(); this._sessions.Add(text, session); result = text; } } return(result); }