AndroidAsync icon indicating copy to clipboard operation
AndroidAsync copied to clipboard

Fix client timeout caused by AsyncNetworkSocket write()

Open jhihn opened this issue 5 years ago • 2 comments

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.

jhihn avatar Oct 02 '20 17:10 jhihn

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

AntoG735 avatar Oct 30 '20 16:10 AntoG735

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.

jhihn avatar Oct 30 '20 21:10 jhihn