[Use-revolution] Re: ResetAll, Sockets, and the new FTP

andu undo at cloud9.net
Tue Nov 27 12:22:00 EST 2001

Troy Rollins wrote:
> andu  wrote:
> >> In the transcript dictionary "ResetAll" claims to close sockets opened by
> >> the FTP function.
> >>
> >> Are there additional relationships held by the FTP and sockets functions?
> >
> > Such as?
> >
> Such as the questions I went on to detail...
> >>
> >> Can one use the openSockets function to get information on the current open
> >> FTP functions?
> >
> > OpenSockets() only returns the open sockets regardless of which protocol
> > opened them. If you need the status of a download or upload use
> > urlStatus() function.
> >
> The URLstatus function looks nice, but seems focused on receiving data,

Should work for both. If you read the docs for urlStatus() you will
learn that in the case of uploading/downloading it also returns the
amount of data transferred and the total amount of data. A script which
will get this information at intervals will tell you when the transfer
is done (the 2 numbers are equal).

> rather than providing information about an upload process. Will it return
> any information relating to an upload? Will at least the "contacted" result
> return true if a connection is made for upload? Will "error" result if the
> server is not found?
> >
> >>
> >> Does the FTP function automatically close the socket it uses to make the
> >
> > No, you can reuse a socket opened to the same server. Servers usually
> > time-out (close) an unused connection after a while (you get a dialog)
> > but the library has an internal timeout-disconnect mechanism which
> > closes the socket after 3 minutes of inactivity.
> >
> >> transfer? If so, does it send any indication of this, or can you use the
> >> previously mentioned socket functions to develop monitoring routines for it?
> I'm not too clear on this - does an upload which is finished provide any
> indication of that status? If the socket does not automatically close when
> an upload is done, and URLstatus does not provide an "upload process done",
> how would one monitor status of a queued series of uploads? I would ideally
> like to restrict the queue to four simultaneous connections, and as
> processes finish allow more queued upload functions to take place.

See above. You can do simultaneous transactions since ftp uses 2 sockets
one for data transfer and one for commands; the one for data transfer is
closed when the operation id done but you can open several of them at
the same time since they use different ports.

> Thanks for any advise.
> --
> Troy Rollins
> RPSystems
> www.rpsystems.net
> ph (860)633-2295
> fax (801)761-9715

 Regards, Andu

More information about the use-livecode mailing list