libUrlFtpUploadFile - reuse open sockets?

Sarah Reichelt sarah.reichelt at gmail.com
Tue Apr 14 23:23:52 EDT 2009


> While using libUrlFtpUploadFile to upload a bunch of files to a server, I
> find that libUrlFtpUploadFile opens a new socket for each upload. Even using
> a callback message to start a new one when the current one finishes, I get a
> "max number of connections" message back from the server when the server's
> max number is reached. After this, the next few upload attempts fail due to
> max number of connections; then as the open connections time out, new files
> can successfully upload again.

I had this problem with a particular server. I always get the new
connection with every command, but not all servers mind this.
My solution was to use libURLSetFTPStopTime and set it to a very small
number. This supposedly allows re-use of an existing connection, but
in my experience all it does it keep one open while still opening
another. If you set it to a very low number, then connections will
close more rapidly, so you should not reach the maximum number of
connections allowed.

HTH,
Sarah



More information about the use-livecode mailing list