login about faq

We’re having issues with transferring files.

It seems that the FTP is failing because PORT 21 is not staying alive past 300 seconds.

Is there a means to include a KEEPALIVE clause in our SQL Scripts to keep port 21 alive past 300 seconds?

asked Sep 20 '12 at 15:26

chilkat's gravatar image

chilkat ♦♦

how can this be done while it is uploading a file? ftp2.PutFile() is blocking the thread.


answered Jan 10 '13 at 22:20

ftper's gravatar image


I don't personally use the FTP component, so this is only a guess, but you could try sending the NOOP in the FtpPercentDone or AbortCheck events and see if it works.

(Jan 11 '13 at 08:11) jpbro ♦

In general, this shouldn't be a problem. Chilkat automatically uses the SO_KEEPALIVE socket option for the control connection. Therefore, at the TCP/IP networking level, the connection should remain alive even for long transfers.

The FTP protocol works as follows for a data transfer:

1) Client sends the appropriate command, such as STOR or RETR, on the command channel.

2) The data connection is established and the FTP server sends a preliminary reply on the control connection.

3) The data transfer occurs.

4) The server sends the final reply on the control connection.

This implies two things:

1) The FTP server certainly wouldn't close the control connection because it knows a transfer is in progress and once complete, it must send the final reply.

2) Additional control-channel commands cannot be sent while a data transfer is in progress. This would interfere with the state of the control channel -- namely that the client expect the next reply to be the final reply for the data transfer, and the server is not expecting new commands until the transfer is complete.

If the SQL Server is somehow interfering with the FTP control connection, then the solution would probably come from some sort of SQL Server setting, configuration, etc. I really don't know enough about SQL Server to know, or even if SQL Server would actually interfere with an FTP control connection. For example -- how would it even know such a connection exists? (because the connection is something that occurs within the Chilkat object and is not exposed to the caller)


answered Jan 12 '13 at 15:10

chilkat's gravatar image

chilkat ♦♦

One possible solution is to periodically send a NOOP command to the FTP server. You can do this by calling the ftp2.Noop() method.


answered Sep 20 '12 at 15:28

chilkat's gravatar image

chilkat ♦♦

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: Sep 20 '12 at 15:26

Seen: 5,317 times

Last updated: Jan 12 '13 at 15:10

powered by OSQA