void webSocketServer_SessionClosed(WebSocketSession session, SuperSocket.SocketBase.CloseReason value)
 {
     log.Debug("removing web socket session : " + value.ToString());
     lock (webSocketSessions)
         webSocketSessions.Remove(session);
 }
示例#2
0
        private static void WsServer_SessionClosed(WebSocketSession _session, SuperSocket.SocketBase.CloseReason _value)
        {
            _session.Send("Your session has now been closed, thanks for participating!" + "The reason for the stream closing is the following: " + _value.ToString());


            for (int i = 0; i < m_NrOfClientsConnected; i++)
            {
                if (m_WsSessions[i].ToString() == _session.SessionID)
                {
                    m_WsSessions[i] = m_WsSessions[m_NrOfClientsConnected - 1];
                    WebSocketSession[] tempArr = new WebSocketSession[m_NrOfClientsConnected];
                    for (int x = 0; x < m_NrOfClientsConnected - 1; x++)
                    {
                        tempArr[x] = m_WsSessions[x];
                    }
                    m_WsSessions = tempArr;
                }
            }
            m_NrOfClientsConnected--;
        }
示例#3
0
 private static void Server_OnClosed(WebSocketSession arg1, SuperSocket.SocketBase.CloseReason arg2)
 {
     Console.WriteLine("Closed:{0},{1}", arg1.SessionID, arg2.ToString());
 }
示例#4
0
 private static void SessionClosed(WebSocketSession session, SuperSocket.SocketBase.CloseReason value)
 {
     Console.WriteLine("Session closed: " + value.ToString());
 }