Archived Forum Post

Index of archived forum posts


FTP Data Connection Fails: SocketError: WSAEWOULDBLOCK The socket would block.

Jun 29 '12 at 12:04

When using the older version I am able to get a directory listing. But when I am using the new version I am not able to get the directory listing. I changed the time out value but no luck with that either. I am connecting to the same server with the same parameters. Here is the error message for the new 9.3.1 version.

    DllDate: Jun  4 2012
    UnlockPrefix: *
    Architecture: Little Endian; 32-bit
    Language: .NET 2.0
    FTP directory cache not fresh.  Fetching dir listing...
      supportsMLSD: 0
      MLSD is only used for full directory listings.  Using LIST instead...
        Passive transfer mode
        EPSV_reply: 229 ENTERING EXTENDED PASSIVE MODE (|||*|)
          hostname: *
          ConnectTimeoutMs_1: 60000
          calling ConnectSocket2
          IPV6 enabled connect with NO heartbeat.
          This is an IPV4 numeric address...
              ai_flags: 4
              ai_family: 2
              ai_socktype: 1
              ai_protocol: 0
              ai_addrlen: 16
              ai_canonname: (NULL)
          Connect using IPV4.
          ipAddress1: ***
          timeout waiting for connect to complete
          numSec: 15
          numMicroSec: 532000
          Connect function failed..
          SocketError: WSAEWOULDBLOCK The socket would block.
          For more information see this Chilkat Blog post:
        Failed to setup passive data socket for LIST.
    N: -1


Whenever a data connection fails because of a timeout, it's because of a firewall blocking the connection. It could be a firewall on the client-side and/or server-side. The typical solution is: If using passive mode, then switch to active (non-passive) mode by setting the ftp.Passive property = false. If using active mode, then switch to passive mode. To understand passive/active modes for FTP, see this: FTP Passive and Active Modes Explained.

The default mode for Chilkat FTP2 was changed from active to passive in v9.3.1. The reason is that it's more common for passive to be the non-blocked FTP mode vs. active.

If setting the Passive property to the opposite value does not solve the problem, see this Chilkat blog post about additional settings: Determining FTP2 Connection Settings