Exemplo n.º 1
0
        // Remove the references to our handler
        private void HandlerOnOnClose(object sender, CloseEventArgs closedata)
        {
            WebSocketHttpServerHandler obj = sender as WebSocketHttpServerHandler;

            UnSubscribeToEvents(obj);

            lock (_activeHandlers)
                _activeHandlers.Remove(obj);
            obj.Dispose();
        }
 public void Shutdown()
 {
     m_Handler.OnClose            -= Handler_OnClose;
     m_Handler.OnText             -= Handler_OnText;
     m_Handler.OnUpgradeCompleted -= Handler_OnUpgradeCompleted;
     m_Handler.OnData             -= Handler_OnData;
     m_Handler.OnPing             -= Handler_OnPing;
     m_Handler.OnPong             -= Handler_OnPong;
     if (m_Handler != null)
     {
         m_Handler.Dispose();
         m_Handler = null;
     }
     if (activeHandler != null)
     {
         activeHandler.Dispose();
         m_Handler = null;
     }
 }