<small id='4vn1F'></small><noframes id='4vn1F'>

    <legend id='4vn1F'><style id='4vn1F'><dir id='4vn1F'><q id='4vn1F'></q></dir></style></legend>
    • <bdo id='4vn1F'></bdo><ul id='4vn1F'></ul>

    1. <i id='4vn1F'><tr id='4vn1F'><dt id='4vn1F'><q id='4vn1F'><span id='4vn1F'><b id='4vn1F'><form id='4vn1F'><ins id='4vn1F'></ins><ul id='4vn1F'></ul><sub id='4vn1F'></sub></form><legend id='4vn1F'></legend><bdo id='4vn1F'><pre id='4vn1F'><center id='4vn1F'></center></pre></bdo></b><th id='4vn1F'></th></span></q></dt></tr></i><div id='4vn1F'><tfoot id='4vn1F'></tfoot><dl id='4vn1F'><fieldset id='4vn1F'></fieldset></dl></div>

    2. <tfoot id='4vn1F'></tfoot>

      FluentFTP - 连接时出现错误“尝试从套接字流读取

      时间:2023-06-04
        <bdo id='adjhP'></bdo><ul id='adjhP'></ul>
          <i id='adjhP'><tr id='adjhP'><dt id='adjhP'><q id='adjhP'><span id='adjhP'><b id='adjhP'><form id='adjhP'><ins id='adjhP'></ins><ul id='adjhP'></ul><sub id='adjhP'></sub></form><legend id='adjhP'></legend><bdo id='adjhP'><pre id='adjhP'><center id='adjhP'></center></pre></bdo></b><th id='adjhP'></th></span></q></dt></tr></i><div id='adjhP'><tfoot id='adjhP'></tfoot><dl id='adjhP'><fieldset id='adjhP'></fieldset></dl></div>
          <legend id='adjhP'><style id='adjhP'><dir id='adjhP'><q id='adjhP'></q></dir></style></legend>
        • <tfoot id='adjhP'></tfoot>
            <tbody id='adjhP'></tbody>

            1. <small id='adjhP'></small><noframes id='adjhP'>

              • 本文介绍了FluentFTP - 连接时出现错误“尝试从套接字流读取数据时超时!"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                得到

                尝试从套接字流中读取数据时超时!

                Timed out trying to read data from the socket stream!

                使用 FluentFTP 连接到 FTP 时.

                when connecting to FTP using FluentFTP.

                下面是我用来连接的源代码:

                Below is the source code which I am using to connect:

                Console.WriteLine("Configuring FTP to Connect to {0}", hostname);
                ftp = new FtpClient(hostname,port,new NetworkCredential(username,password));               
                ftp.ConnectTimeout = 600000;               
                ftp.ReadTimeout = 60000;
                ftp.EncryptionMode = FtpEncryptionMode.Explicit;
                ftp.SslProtocols = System.Security.Authentication.SslProtocols.Tls;
                ftp.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
                ftp.Connect();
                Console.WriteLine("Connected to {0}", hostname);
                
                ftp.SetWorkingDirectory(foldername);
                Console.WriteLine("Changed directory to {0}", foldername);
                

                void OnValidateCertificate(FtpClient control, FtpSslValidationEventArgs e)
                {
                    // add logic to test if certificate is valid here
                    e.Accept = true;
                }
                

                <小时>

                用于成功连接的 FileZilla 日志文件.我可以通过 FileZilla 连接该位置.日志片段如下:


                FileZilla log file for successful connectivity. I am able to connect the location via FileZilla. Snippet of log is below:

                2017-12-08 13:34:33 17672 1 Status: Connecting to xx.xx.xx.xx:990...
                2017-12-08 13:34:33 17672 1 Status: Connection established, initializing TLS...
                2017-12-08 13:34:33 17672 1 Status: Verifying certificate...
                2017-12-08 13:35:06 17672 1 Status: TLS connection established, waiting for welcome message...
                2017-12-08 13:35:06 17672 1 Response: 220-Microsoft FTP Service
                2017-12-08 13:35:06 17672 1 Status: Invalid character sequence received, disabling UTF-8. Select UTF-8 option in site manager to force UTF-8.
                2017-12-08 13:35:06 17672 1 Response:     Warning: This IT system is restricted to company authorised users only, including authorised third parties. Unauthorised access or use is a violation of Company’s policies and potentially the law. 
                2017-12-08 13:35:06 17672 1 Response:     
                2017-12-08 13:35:06 17672 1 Response: 220 Our IT systems may be monitored for administrative and security reasons. By proceeding, you acknowledge that you have read and understood this notice and that you consent to the monitoring. [ftps0]
                2017-12-08 13:35:06 17672 1 Command: USER ftp_usr_comp_ext
                2017-12-08 13:35:06 17672 1 Response: 331 Password required
                2017-12-08 13:35:06 17672 1 Command: PASS ****************
                2017-12-08 13:35:06 17672 1 Response: 230 User logged in.
                2017-12-08 13:35:06 17672 1 Command: SYST
                2017-12-08 13:35:06 17672 1 Response: 215 Windows_NT
                2017-12-08 13:35:06 17672 1 Command: FEAT
                2017-12-08 13:35:06 17672 1 Response: 211-Extended features supported:
                2017-12-08 13:35:06 17672 1 Response:  LANG EN*
                2017-12-08 13:35:06 17672 1 Response:  UTF8
                2017-12-08 13:35:06 17672 1 Response:  AUTH TLS;TLS-C;SSL;TLS-P;
                2017-12-08 13:35:06 17672 1 Response:  PBSZ
                2017-12-08 13:35:06 17672 1 Response:  PROT C;P;
                2017-12-08 13:35:06 17672 1 Response:  CCC
                2017-12-08 13:35:06 17672 1 Response:  HOST
                2017-12-08 13:35:06 17672 1 Response:  SIZE
                2017-12-08 13:35:06 17672 1 Response:  MDTM
                2017-12-08 13:35:06 17672 1 Response:  REST STREAM
                2017-12-08 13:35:06 17672 1 Response: 211 END
                2017-12-08 13:35:06 17672 1 Command: PBSZ 0
                2017-12-08 13:35:07 17672 1 Response: 200 PBSZ command successful.
                2017-12-08 13:35:07 17672 1 Command: PROT P
                2017-12-08 13:35:07 17672 1 Response: 200 PROT command successful.
                2017-12-08 13:35:07 17672 1 Status: Logged in
                2017-12-08 13:35:07 17672 1 Status: Retrieving directory listing of "/Prod/Outbound"...
                2017-12-08 13:35:07 17672 1 Command: CWD /Prod/Outbound
                2017-12-08 13:35:07 17672 1 Response: 250 CWD command successful.
                

                堆栈跟踪:

                   at FluentFTP.FtpSocketStream.Read(Byte[] buffer, Int32 offset, Int32 count)
                   at FluentFTP.FtpSocketStream.ReadLine(Encoding encoding)
                   at FluentFTP.FtpClient.GetReply()
                   at FluentFTP.FtpClient.Handshake()
                   at FluentFTP.FtpClient.Connect()
                   at ASOSSFTP.DownloadFile.DownloadFileFromFTP()
                

                推荐答案

                在 FileZilla 中,您正在连接到 implicit FTPS 端口 990.

                In FileZilla, you are connecting to implicit FTPS port 990.

                如果在 C# 中也使用此端口,则不能使用 FtpEncryptionMode.Explicit.

                If you also use this port in C#, you cannot use FtpEncryptionMode.Explicit.

                使用FtpEncryptionMode.Implicit.

                虽然你最好连接到端口 21 并继续使用 FtpEncryptionMode.Explicit,如果该端口可用的话.

                Though you better connect to port 21 and keep using FtpEncryptionMode.Explicit, if that port is available.

                这篇关于FluentFTP - 连接时出现错误“尝试从套接字流读取数据时超时!"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:C# - FtpWebRequest - 通过同一连接/登录的多个请求 下一篇:550 文件不可用错误与 FtpWebRequest 类文件上传.在

                相关文章

                最新文章

              • <i id='CTDSs'><tr id='CTDSs'><dt id='CTDSs'><q id='CTDSs'><span id='CTDSs'><b id='CTDSs'><form id='CTDSs'><ins id='CTDSs'></ins><ul id='CTDSs'></ul><sub id='CTDSs'></sub></form><legend id='CTDSs'></legend><bdo id='CTDSs'><pre id='CTDSs'><center id='CTDSs'></center></pre></bdo></b><th id='CTDSs'></th></span></q></dt></tr></i><div id='CTDSs'><tfoot id='CTDSs'></tfoot><dl id='CTDSs'><fieldset id='CTDSs'></fieldset></dl></div>

                <tfoot id='CTDSs'></tfoot>

                  <small id='CTDSs'></small><noframes id='CTDSs'>

                1. <legend id='CTDSs'><style id='CTDSs'><dir id='CTDSs'><q id='CTDSs'></q></dir></style></legend>
                      <bdo id='CTDSs'></bdo><ul id='CTDSs'></ul>