chandys / proxoid

Automatically exported from code.google.com/p/proxoid
0 stars 0 forks source link

Incomplete transfert when the application is used between two speed different network #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I used the application on a mobile which is connected through a VPN to a LAN 
and to the Internet with the classic HSDPA connection.

I try to retrieve files from the Internet from on a computer in the LAN.

My HSDPA connection is much faster than the VPN one, and that why the file 
transfert finishes earlier on the Proxy<->Server side.

The problem is that on big files, the server closes the socket before the 
mobile application could send all the remaining buffer to the client.

I  modify the write method to avoid this problem.

private void write(Socket socket, ByteBuffer b, long when) throws IOException {
    while(b.hasRemaining()){
        socket.socket.write(b);
        socket.lastWrite = when;
    }
}

I tested this on an HTC Desire with Android 2.2 and it resolved my transfert 
problems.

If you reproduce this issue, you could maybe commit this modification in future 
release.

Best regards,

Max

Original issue reported on code.google.com by maxime.l...@gmail.com on 1 Nov 2011 at 12:19