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

Fix client timeout caused by AsyncNetworkSocket write() #684

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhihn
Copy link

@jhihn jhihn commented Oct 2, 2020

There is a problem when a large (>345 kB) message is being written to a websocket. The connection will actually time out, unless this while is in place. Unfortunately, this pretty much busy-waits. But whatever the queueing mechanism is, is broken at least for websockets and large messages. My messages are ~2MB.

.154 AndroidAsync: before:1926139
.154 AndroidAsync: remaining:1577171
.156 AndroidAsync: before:1926139
.156 AndroidAsync: remaining:1577171
.158 AndroidAsync: before:1926139
...
.240 AndroidAsync: remaining:0

Without this, your connection will be dropped by the remote side. Tested with C++ qtwebsockets and Python websockets clients.

The two part write()/handleRemaining() does not seem to handlw when handleRemaining() still has remaining properly.

There i a problem when a large (>345 kB) message is being written to a websocket. The connection will actually time out, unless this while is in place. Unfortunately, this pretty much busy-waits. But whatever the queueing mechanism is is broken at least for websockets and large messages. My messages are ~2MB. 

    .154 AndroidAsync: before:1926139
    .154 AndroidAsync: remaining:1577171
    .156 AndroidAsync: before:1926139
    .156 AndroidAsync: remaining:1577171
    AndroidAsync: before:1926139
    ...
    .240 AndroidAsync: remaining:0
@jhihn jhihn changed the title Update AsyncNetworkSocket.java Fix client timeout caused by AsyncNetworkSocket write() Oct 2, 2020
@AntoG735
Copy link

I have the same problem, when the PR can be approved ? :)

@jhihn
Copy link
Author

jhihn commented Oct 30, 2020

I don't think the PR is proper, it just "fixes" the problem in a nuclear way. The gh github client can probably cherry pick this for you.

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

Successfully merging this pull request may close these issues.

2 participants