Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

November 14, 2007

WSAEWOULDBLOCK when trying to establish FTP2 Data Connection in Passive Mode with SSL/TLS

If the Chilkat FTP2 component fails to establish the data connection when uploading or downloading a file in passive mode using SSL/TLS, then check to see if the host address is reported as 192.168.*.*. If so, it is likely that your NAT router (Network Address Translating Router) was not able to convert the IP address contained within the FTP server’s PASV response from an external IP to an internal IP address. The "192.168″ indicates an internal address. Setting the PassiveUseHostAddr property = true causes the FTP2 component to ignore the IP address returned in the PASV response and use the IP of the existing control connection. (The port number is not ignored.)

Note: You don’t necessarily need to understand that explanation. In summary, if you see "WSAEWOULDBLOCK" and "192.168″ in the LastErrorText, then try setting the PassiveUseHostAddr property = true.

Here’s a sample LastErrorText:

ChilkatLog:
    PutFile:
        LocalFilename: ***
        RemoteFilename: ****
        DllDate: Nov 14 2007
        Username: ****
        Component: .NET 2.0
        Passive transfer mode
        hostAddr: 192.168.40.162
        DataConnect:
            hostname: 192.168.40.162
            port: 20026
            socket is not ready for writing
            Connect function failed
            SocketError: WSAEWOULDBLOCK The socket would block
            Check to make sure the port is not blocked by a firewall.
        Failed to setup passive data socket.
        Failed.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.