public void Dispose() { if (FTPCommandListner != null) { bClose = true; Thread.CurrentThread.Join(1000); if (FTPCommandListner.Pending()) { FTPCommandListner.Stop(); } //FTPCommandListner.Stop(); } }
public void Stop() { if (listener != null) { listener.Stop(); } }
public void Stop() { if (stopped) { return; } stopped = true; _tcpListener?.Stop(); _udpListener?.Stop(); StopPlugins(); if (privoxyRunner != null) { privoxyRunner.Stop(); } if (_config.enabled) { SystemProxy.Update(_config, true, null); } }
public static void CloseServer() { try { TCPListener.Stop(); UDPClient.Close(); Console.WriteLine($"\tClosed Server: {ServerName}"); } catch (Exception exception) { Console.WriteLine($"\tError closing Server: {ServerName}...\n{exception}"); } if (MainServerComms.EstablishedConnection) { Environment.Exit(1); } }
public bool Stop() { if (IsShuttingDown) { return(false); } try { UDPReciever.Close(); TCPListener.Stop(); IsShuttingDown = true; } catch { //??? } return(IsShuttingDown); }
/// <summary> /// Dispose /// </summary> public void Dispose() { if (TCPListener != null) { TCPListener.Stop(); TCPListener = null; } if (listenerThread != null) { listenerThread.Join(); listenerThread = null; } lock (serverConnections) { foreach (ServerConnection server_connection in serverConnections) { server_connection.Dispose(); } serverConnections.Clear(); } }
//Passive Data MODE private int PassiveModePort(ref TCPListener clientDataListner) { Thread oThread = Thread.CurrentThread; lock (oThread) { int intPort = 0; bool done = true; while (done) { intPort = Port(); try { if (clientDataListner != null) { clientDataListner.Stop(); } clientDataListner = new TCPListener(intPort); clientDataListner.Start(); //This Port is free done = false; } catch (Exception e) { //done=false; } } return(intPort); /* * strIPAddress = CStr(wscControl.LocalIP) * strSend = "PORT " & Replace(strIPAddress, ".", ",") * strSend = strSend & "," & intPort \ 256 & "," & (intPort Mod 256) * strSend = strSend & vbCrLf * wscControl.SendData strSend */ } }
public void Stop() { Listener.Stop(); }
private void Button1_Click(object sender, EventArgs e) { listener.Stop(); }
public void Stop() { _tcpListener?.Stop(); _udpListener?.Stop(); }
public void Stop() { mutex.Set(); thread.Join(); listener.Stop(); }
private static void OnEndingConsoleApplication(object sender, EventArgs e) { TCPListener.Stop(); UDPClient.Close(); }