Archived Forum Post

Index of archived forum posts


Ftp2 library: Connect to a default remote directory.

Jan 21 '14 at 09:08

I'm trying to connect to an FTP server, but the Connect method fails with reason 200 (Connected, but failed to receive greeting from FTP server). After that the client is disconnected (IsConnected = false) and I cannot issue any commands.

For the same server, using FileZilla, I have to set the "Default Remote Directory" to a provided value and it works (otherwise it also fails).

How can I achieve connecting to a default directory, using the Chilkat library? In my case I cannot issue a CWD command, because the client needs to be connected.

Follows the log from Chilkat library (replaced sensitive information with *):

    DllDate: Aug 15 2013
    UnlockPrefix: Test
    Username: ***
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 1
      enabled: yes
      heartbeatMs: 0
      sendBufferSize: 65536
    ImplicitSsl: 0
    AuthTls: 0
    AuthSsl: 0
    Hostname: ***
    Port: 21
    IdleTimeoutMs: 15000
    ConnectTimeout: 15
    ConnectTimeoutMs_1: 15000
    calling ConnectSocket2
    IPV6 enabled connect with NO heartbeat.
    connectingTo: ***
      Resolving domain name (IPV4) via gethostbyname
    GetHostByNameHB_ipv4: Elapsed time: 312 millisec
    myIP_1: ***
    myPort_1: 52338
    connect successful (1)
    Turning on TCP_NODELAY.
      SO_SNDBUF: 8192
      SO_RCVBUF: 8192
      TCP_NODELAY: 1
      rcvUntilMatchStringQP: =0A
      Timeout waiting to read socket or accept connection
      timeoutMs: 15000
      recvUntilMatch: Socket timeout.
      Failed to read FTP response line..
    initialStatus: -1
    Failed to connect to FTP server.


Eventually it was as simple as increasing the IdleTimeoutMs from 15000 to 60000. Spend 3 hours on this. I feel so stupid!