Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Aug 3, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant