Skip to content

Commit

Permalink
Update FtpClient_Stream.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiaman1 authored Apr 21, 2020
1 parent 98d2f18 commit f6c4399
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion FluentFTP/Client/FtpClient_Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ private FtpDataStream OpenActiveDataStream(FtpDataConnectionType type, string co
stream.EndAccept(args, m_dataConnectionConnectTimeout);
#else
ar.AsyncWaitHandle.WaitOne(m_dataConnectionConnectTimeout);
ar.AsyncWaitHandle.Close();
if (!ar.IsCompleted) {
stream.Close();
throw new TimeoutException("Timed out waiting for the server to connect to the active data socket.");
Expand Down Expand Up @@ -817,6 +818,7 @@ private FtpDataStream OpenActiveDataStream(FtpDataConnectionType type, string co
stream.EndAccept(args, m_dataConnectionConnectTimeout);
#else
ar.AsyncWaitHandle.WaitOne(m_dataConnectionConnectTimeout);
ar.AsyncWaitHandle.Close();
if (!ar.IsCompleted) {
stream.Close();
throw new TimeoutException("Timed out waiting for the server to connect to the active data socket.");
Expand Down Expand Up @@ -1852,4 +1854,4 @@ protected void EndSetDataType(IAsyncResult ar) {
#endregion

}
}
}

0 comments on commit f6c4399

Please sign in to comment.