Add() private method

private Add ( IWebSocketSession session ) : string
session IWebSocketSession
return string
 private void onOpen(object sender, EventArgs e)
 {
     _id = _sessions.Add(this);
     if (_id == null)
     {
         _websocket.Close(CloseStatusCode.Away);
         return;
     }
     _startTime = DateTime.Now;
     OnOpen();
 }
Beispiel #2
0
        private Task InnerOnOpen()
        {
            _id = _sessions.Add(this);
            if (_id == null)
            {
                _websocket.Close(CloseStatusCode.Away);
                return(Task.FromResult(false));
            }

            _start = DateTime.Now;
            return(OnOpen());
        }
Beispiel #3
0
        private void HandleOnOpen(object sender, EventArgs e)
        {
            _id = _sessions.Add(this);

            if (string.IsNullOrEmpty(_id))
            {
                _websocket.Close(CloseStatusCode.Away);
                return;
            }

            _startTime = DateTime.Now;

            OnOpen();
        }