/// <summary> /// Closes the <see cref="T:System.Net.Sockets.Socket"/>. /// </summary> public void Close() { lock (syncRoot) { if (socket != null) { socket.Close(); socket = null; } } }
/// <summary> /// Stops the listening and closes the socket. /// </summary> public void Stop() { if (log.IsDebugEnabled) { log.DebugFormat("Stopp listening on {0}", LocalEndPoint); } lock (_lock) { running = false; if (socket != null) { socket.Close(); socket = null; } } }