realbasic-nug
[Top] [All Lists]

ftp socket uploading problem

To: Users REALbasicNUGlist Network Users <realbasic-nug@lists.realsoftware.com>
Subject: ftp socket uploading problem
From: Carlo Rubini <osb@bttb.net.bd>
Date: Mon, 30 Jun 2008 18:04:02 +0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; dkim=neutral (body hash did not verify) header.i=@gmail.com
Delivered-to: listarchive@realsoftware.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version :content-transfer-encoding:message-id:content-type:to:from:subject :date:x-mailer:sender; bh=peexTUPa+nylO4PSWIMU052ZrcThiOQLqK3+TPDPR+g=; b=WlMD7hclvyFmd3FR7lGwzt1VboBLMpWKML/MhPNuIeCglWl2LdFZ91aKgw4rx0wocD sSebyflPzPmF2xJvNupTd8vHocDYKal/g9hbDvLeI/eubQvRmKIk2ahgI6HELHdX5+qN c2CZ2tZjsg4g4wFYnYzz4DkyvA0qoUDSVyhCo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-transfer-encoding:message-id:content-type:to :from:subject:date:x-mailer:sender; b=t5zaqA0MBTbWPSrH6WoWwmPKEoInDtFLM6YIdaMAvnV2Wp4fHun8bqUWkYDXwGyV5Q YLhBuV3Ol7+qFn6jWLrybszd7wjbGd0PlQP5pi+ln8ZKl5i46iOxfcmUovyxN9Q//q9r hRbiZq98stSyXjUoPRrU1Lkdp5Rf2MvHI62EE=
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
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>


<Prev in Thread] Current Thread [Next in Thread>