libUrlFtpUploadFile - reuse open sockets?

Jim Ault jimaultwins at yahoo.com
Tue Apr 14 21:02:16 EDT 2009


I think that using a callback handler you can detect the 100% complete  
message from the server,
then issue a 'QUIT' to close the connection immediately, then after  
getting the 'GOODBYE', start the next upload.

I have not done this in practice that I know of (accidents do happen  
and things work without you knowing why).

Jim Ault
Las Veagas
On Apr 14, 2009, at 3:34 PM, Phil Davis wrote:

> Howdy -
>
> 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.
>
> So... I want to know:
>
> 1) Does FTP require a new socket for each upload?
>
> 2) If not, how do I tell libUrlFtpUploadFile to reuse an existing  
> open socket for the next upload?
>
> 3) Is there something else I'm missing? Am I making things more  
> complicated than they need to be? I have a nagging suspicion along  
> this line...
>
>
> Here's how my code is structured:
>
> on uploadMyFile pLocalFile, pServerPath
> libUrlFtpUploadFile pLocalFile,pServerPath,"uploadEnded"
> end uploadMyFile
>
> on uploadEnded pUrl, pStatus
> put pUrl & tab & pStatus & cr after fld "callbackParams"
> put nextFileFromList() into p1
> put nextServerPath() into p2
> send ("uploadMyFile" && p1 & comma & p2) to me in 6 ticks
> end uploadEnded
>
>
> Many thanks for your help.
> -- 
> Phil Davis
>
> PDS Labs
> Professional Software Development
> http://pdslabs.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list