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

ChilkatLog:
  NumFilesAndDirs:
    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
    ListDir:
      No socket exists for sending (2b)
      Failed to send TLS message.
      Failed to send PBSZ command
    --ListDir
    N: -1
    Failed.
  --NumFilesAndDirs
--ChilkatLog

asked Jun 19 '12 at 19:23

emartinson's gravatar image

emartinson
148162030


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.

link

answered Jun 20 '12 at 08:31

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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

By RSS:

Answers

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

Tags:

×96
×90
×32
×7

Asked: Jun 19 '12 at 19:23

Seen: 2,541 times

Last updated: Jun 20 '12 at 18:07

powered by OSQA