Hello,
I have a subclassed ftp socket that has been working all right for
some years.
Last week all at once, without having changed a single line of code,
it started randomly stopping an uploading process. For instance, it
may stop after having uploaded 100k, or 350k or 900k and so on and so
forth.
This happens when for a few seconds there are not (in the
sendProgress event) bytes to be sent, probably because the internet
connection is having a slowdown of its own. This particular problem
(i.e. the connection slowing down) happened also before, but after a
few seconds or even a few minutes, the uploading process would
resume. Now, all at once, the socket seems to sleep for ever and ever.
The code I have been using is the one posted a few years ago by Aaron:
the process starts with:
upSocket.write(mBinary.read(mBinary.length))
then:
Function SendProgress(bytesSent as Integer, bytesLeft as Integer) As
Boolean
if mBinary.EOF then
if BytesLeftToSend > 0 then return false
me.close
return true
end if
me.Write(mBinary.read(bytesSent))
End Function
When the problem occours even polling the socket does not do
anything; at the same time I can see that the socket.isConnected, and
the bytesLeft and the BytesLeftToSend are > then 0.
At present, the only way that *seems* to work is to start the process
with:
upSocket.write(mBinary.read(20 * 1024 * 1024))// instead of
mBinary.length as above.
The curious thing is that passing a different value (ex. 2 * 1024 *
1024 or 40 * 1024 * 1024 etc.) does not solve the problem. That's why
I would not like to make everything depend on this chance value.
Suggestions welcome. Thanks,
RB 5.5.5 Mac OS 10.4.5
Carlo
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|