You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by cl...@comcast.net on 2009/04/22 21:01:29 UTC

[commons-net] FTPClient setReceiveBufferSize() setSendBufferSize()

I have an ftp connection that would greatly benefit from having very large TCP/IP window sizes (1MB). I'm having trouble figuring out how to implement this using the standard FTPClient. What's the intended usage of setReceiveBufferSize() and setSendBufferSize(), which are inherited from the SocketClient? 

>From what I understand, setReceiveBufferSize() must be set prior to binding to the socket? However, if these methods are called prior to FTPClient.connect(), then this socket object isn't initialized. After FTPClient.connect(), is it too late? 

Any insight into configuring the FTPClient to configure these window sizes is greatly appreciated. 

Thanks, 

Phil 

Re: [commons-net] FTPClient setReceiveBufferSize() setSendBufferSize()

Posted by Steve Cole <sc...@camsbycbs.com>.
Download the source, modify the SocketClient.connect() method and use the
setReceiveBufferSize() and setSendBufferSize() methods and see if it gives
you results you want.

Have you tried using the FTPClient.setBufferSize() method, which sets the
buffersize of the BufferedInputStream used for the retrieveFile() method and
BufferedOutstream used for the storeFile() method?

----- Original Message ----- 
From: <cl...@comcast.net>
To: <us...@commons.apache.org>
Sent: Wednesday, April 22, 2009 3:01 PM
Subject: [commons-net] FTPClient setReceiveBufferSize() setSendBufferSize()


> I have an ftp connection that would greatly benefit from having very large
TCP/IP window sizes (1MB). I'm having trouble figuring out how to implement
this using the standard FTPClient. What's the intended usage of
setReceiveBufferSize() and setSendBufferSize(), which are inherited from the
SocketClient?
>
> From what I understand, setReceiveBufferSize() must be set prior to
binding to the socket? However, if these methods are called prior to
FTPClient.connect(), then this socket object isn't initialized. After
FTPClient.connect(), is it too late?
>
> Any insight into configuring the FTPClient to configure these window sizes
is greatly appreciated.
>
> Thanks,
>
> Phil
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [commons-net] FTPClient setReceiveBufferSize() setSendBufferSize()

Posted by Rory Winston <ro...@gmail.com>.
Hi Phil

Actually, there was a long-standing latent bug in [net] where calls to  
set the socket buffer size were effectively ignored, as they were  
applied after the socket had been bound. This has recently been fixed  
in the 2.0 branch head. See:

http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/SocketClient.java?r1=749145&r2=762023&diff_format=h

So, as Steve says, you can either make these changes locally, or just  
download the latest source from the 2.0 branch and use that.

--Rory

On 22 Apr 2009, at 20:01, cloudboy@comcast.net wrote:

> I have an ftp connection that would greatly benefit from having very  
> large TCP/IP window sizes (1MB). I'm having trouble figuring out how  
> to implement this using the standard FTPClient. What's the intended  
> usage of setReceiveBufferSize() and setSendBufferSize(), which are  
> inherited from the SocketClient?
>
> From what I understand, setReceiveBufferSize() must be set prior to  
> binding to the socket? However, if these methods are called prior to  
> FTPClient.connect(), then this socket object isn't initialized.  
> After FTPClient.connect(), is it too late?
>
> Any insight into configuring the FTPClient to configure these window  
> sizes is greatly appreciated.
>
> Thanks,
>
> Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org