Skip to content

When I download files, the program crashes but I can't catch the exception #1812

@lixiang365

Description

@lixiang365

I have already used try-catch, but it still crashes.

using var ftp = new AsyncFtpClient(ip, username, password);
ftp.Config.ConnectTimeout = 30000;                        
ftp.Config.ReadTimeout = 60000;      
ftp.Config.DataConnectionConnectTimeout = 30000;  
ftp.Config.DataConnectionReadTimeout = 60000;    

.....
try{
var status = await ftp.DownloadFile(localFilePath, remoteFilePath,
                        FtpLocalExists.Resume,
                        FtpVerify.Delete | FtpVerify.Retry, progress);
}
catch{}

Application: BearCapture.UI.exe CoreCLR Version: 8.0.2526.11203 .NET Version: 8.0.25 Description: The process was terminated due to an unhandled exception. Exception Info: System.TimeoutException: Timed out trying to read data from the socket stream! at FluentFTP.FtpSocketStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) at FluentFTP.FtpSocketStream.ReadLineAsync(Encoding encoding, CancellationToken token) at FluentFTP.Client.BaseClient.BaseFtpClient.FluentFTP.IInternalFtpClient.GetReplyInternal(CancellationToken token, String command, Boolean exhaustNoop, Int32 timeOut, Boolean useSema) at FluentFTP.Client.BaseClient.BaseFtpClient.FluentFTP.IInternalFtpClient.GetReplyInternal(CancellationToken token, String command) at FluentFTP.Client.BaseClient.BaseFtpClient.FluentFTP.IInternalFtpClient.CloseDataStreamInternal(FtpDataStream stream, CancellationToken token) at FluentFTP.Client.BaseClient.BaseFtpClient.FluentFTP.IInternalFtpClient.CloseDataStreamInternal(FtpDataStream stream, CancellationToken token) at FluentFTP.FtpDataStream.CloseAsync(CancellationToken token) at FluentFTP.FtpSocketStream.<>c__DisplayClass77_0.<b__0>d.MoveNext() --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.b__128_1(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

I don't know if it has anything to do with my configuration.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions