createID() private static method

private static createID ( ) : string
return string
        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);
        }
Ejemplo n.º 2
0
        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);
        }