in reply to How can I send more than 1MB to a TCP socket?

FTP protocol fits in this situation better, and you can use some module like Net::FTP. You don't even need to worry about the chunks, as that module would handle this for you.

Checked FTP spec, and theorbtwo is right about the restart (REST But FTP does not resolve one thing... If your connection is unstable and slow, and you lost your connection half way all the time, with the nature of FTP protocol, you have to restart from the very begining. If this is a real problem in your environment, then chunk it yourself, and establish your own little protocol to restart from where it is broken. (I am not talking about the resending done by TCP, that's a totally different level.)

  • Comment on Re: How can I send more than 1MB to a TCP socket?

Replies are listed 'Best First'.
Re: Re: How can I send more than 1MB to a TCP socket?
by theorbtwo (Prior) on Oct 26, 2003 at 17:45 UTC

    Er, as to FTP not supporting restarting, that isn't true. The client mearly has to give a proper REST command before the GET. OTOH, as another poster noted, TCP should deal just fine with arbitrarly long packets.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).