login about faq

The FTP site that I am connecting to is causing an error with .NumFilesAndDirs. Is there are way to use LIST instead?

Thanks, - Erik

    DllDate: Jan 19 2012
    UnlockPrefix: SINSVISFTP
    Username: MATHIS:erik
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    MLSD is only used for full directory listings.  Using LIST instead...
    initialGreeting: 220 xxxxxxxxxxxxxx Public FTP Server
      No socket exists for sending (2b)
      Failed to send TLS message.
      Failed to send PBSZ command
    N: -1

asked Jun 19 '12 at 19:23

emartinson's gravatar image


The "No socket exists for sending" message indicates that in some prior Chilkat method call, the connection to the FTP server was lost. It must be that a previous method call returned a failed status that was not checked. The application continued onward making a call to a Chilkat method/property that requires a command to be sent to the FTP server, but there is no valid connection (i.e. no socket exists).

The same error would occur if the application had never connected in the first place, but I can see that it did because of the "initialGreeting" in the LastErrorText.

It could also be that your application explicitly called the Disconnect method prior to this call.

The first step is to review your application code and make sure that each call to an FTP2 method checks the return value for success/failure and reports the LastErrorText on failure.


answered Jun 20 '12 at 08:31

chilkat's gravatar image

chilkat ♦♦

I have verified that the previous three calls to the ftp were successful (.Connect, .ChangeRemoteDir and .ListPattern). It is the .NumFilesAndDirs that takes about 10 min to return (control) to the VB App and has the error above.

-Logs: http://snipt.org/vahfg1

(Jun 20 '12 at 13:05) emartinson

I suspect you're missing something. The disconnect will surely be seen in a LastErrorText, and it must've occurred somewhere between when the connection was established and when NumFilesAndDirs was accessed.

Try setting the ftp.DebugLogFilePath property equal to the path of a log file to be created. Do this before connecting. Then re-run and examine the log. The log file will contain the LastErrorText's for each Chilkat method called.

(Jun 20 '12 at 16:33) chilkat ♦♦

This issue is resolved. The problem was that when switching to passive mode, the ip that was sent from the ftp server was it's internal ip address not the publicly addressable one. The ftp host made the config change and all is working.

(Jun 20 '12 at 18:07) emartinson
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jun 19 '12 at 19:23

Seen: 3,523 times

Last updated: Jun 20 '12 at 18:07

powered by OSQA