diff --git a/src/FubarDev.FtpServer/MultiBindingTcpListener.cs b/src/FubarDev.FtpServer/MultiBindingTcpListener.cs index 208cc137..587ab626 100644 --- a/src/FubarDev.FtpServer/MultiBindingTcpListener.cs +++ b/src/FubarDev.FtpServer/MultiBindingTcpListener.cs @@ -184,6 +184,11 @@ private async Task AcceptForListenerAsync(TcpListener listener, int // Ignore the exception. This happens when the listener gets stopped. return new AcceptInfo(null, index); } + catch (SocketException ex) when (ex.SocketErrorCode == SocketError.ConnectionReset) + { + // The remote peer closed the connection during the handshake process. We ignore these. + return new AcceptInfo(null, index); + } } private int StartListening(IEnumerable addresses, int port)