I may not be understanding your process, but where are you writing the
data? For instance if I would dump all the data in the connected event
of the data socket (not the command socket). Instead of trying to send
chunks, but then the files I am uploading are small files (couple o
megs at the most).
The other way to do, would be to send the next chunk on the send
complete command not the send progress command.
I hope this helps.
On Jun 30, 2008, at 10:33 PM, realbasic-nug-request@lists.realsoftware.com
wrote:
Message: 18
Date: Mon, 30 Jun 2008 18:04:02 +0600
From: Carlo Rubini <osb@bttb.net.bd>
Subject: ftp socket uploading problem
To: Users REALbasicNUGlist Network Users
<realbasic-nug@lists.realsoftware.com>
Message-ID: <34CB1643-261F-4F19-B9EC-1196D313E2FF@bttb.net.bd>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
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
Have a Great Week :)
Sam Rowlands
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|