Skip to content

Commit

Permalink
Handle connection closed by client
Browse files Browse the repository at this point in the history
  • Loading branch information
fubar-coder committed Aug 16, 2019
1 parent 88dfe8e commit f4fc7ba
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Linq;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -190,6 +191,9 @@ private async Task ExecuteCommandAsync(
_logger?.LogWarning(validationException.Message);
break;

#if !NETSTANDARD1_3
case SocketException se when se.ErrorCode == (int)SocketError.ConnectionAborted:
#endif
case OperationCanceledException _:
response = new FtpResponse(426, localizationFeature.Catalog.GetString("Connection closed; transfer aborted."));
Debug.WriteLine($"Command {command} cancelled with response {response}");
Expand Down

0 comments on commit f4fc7ba

Please sign in to comment.