/// <summary> /// Stops this instance. /// </summary> public void Stop() { if (_listener != null) { try { _listener.Stop(); if (AccessPolicyServer != null && FlashAPEnabled) { AccessPolicyServer.Stop(); } } catch { /* Ignore */ } } _listener = null; AccessPolicyServer = null; Log.Info("SimpleWebsockets server stopped"); }
/// <summary> /// Starts this instance. /// </summary> public void Start() { if (_listener == null) { try { AccessPolicyServer = new AccessPolicyServer(ListenerAddress, OriginHost, Port); if (FlashAPEnabled) { AccessPolicyServer.Start(); } _listener = new TcpListener(ListenerAddress, Port); ThreadPool.QueueUserWorkItem(Listen, null); } catch { /* Ignore */ } } Log.Info("SimpleWebsockets server started"); }