private void startListen() { Stop(); _server = new SocketServer(); _server.Listen(_port); _server.ClientAccepted += Server_ClientAccepted; _server.ErrorOccured += Server_ErrorOccured; }
public void Stop() { if (_server != null) { _server.ClientAccepted -= Server_ClientAccepted; _server.ErrorOccured -= Server_ErrorOccured; _server.Dispose(); } _server = null; }