private void StopListenThread() { try { if (m_listener != null) { if (connected) TVServerConnection.CloseAll(); Log.Info("TVServerKodi: Stop listening"); m_listener.Stop(); m_listener = null; } } catch { Log.Error("TVServerKodi: StopListenThread failed!"); Console.WriteLine("StopListenThread failed!"); } }
private bool StartListenThread() { try { Log.Info("TVServerKodi: Start listening on port " + m_serverPort); Console.WriteLine("TVServerKodi: Start listening on port " + m_serverPort); // start a thread for the listener m_listener = new Listener(m_serverPort); m_listener.StartListening(); } catch { Log.Error("TVServerKodi: StartListenThread failed!"); Console.WriteLine("StartListenThread failed!"); } return false; }