I am trying to develop a simple ftp client using open source ftp4j library for android. I wanted to know if there is any way I can change/increase the tcp window size for data transfer. I have tried changing the receive buffer size on data socket, but when I checked the Wireshark logs the window size was not changing at all, it stays around 195232.
protected Socket tcpConnectForDataTransferChannel(String host, int port) throws IOException {
Socket socket = new Socket();
int size = (1024*1024);
socket.setSoTimeout(readTimeout * 1000);
socket.setSoLinger(true, closeTimeout);
socket.setReceiveBufferSize(size);
socket.setSendBufferSize(size);
socket.connect(new InetSocketAddress(host, port), connectionTimeout * 1000);
Log.d(TAG,String.valueOf(socket.getReceiveBufferSize()));
return socket;
}
Thanks