Closed rgov closed 4 years ago
In the Polling transport's write
method, the transport is set to read-only with this.writable = false;
. A callback callbackfn
is defined which is meant to switch back to read-write.
The callbackfn
is passed to self.doWrite()
as fn
, and it's supposed to be called on Request.EVENT_SUCCESS
. And it appears to be:
EventThread.exec(new Runnable() {
@Override
public void run() {
fn.run();
}
});
However, this does not work.
The EventThread is being blocked by polling: PollingXHR.doPoll()
's handler for Request.EVENT_DATA
events calls Polling._onData()
on the EventThread, which gets stuck.
Resolved. This was an issue in client code. Essentially, a handler for an message type or event can block itself if it tries to emit a message but doesn't return.
I am calling
socket.emit()
repeatedly in a loop (with a few seconds between). However, the server only sees the first message. No disconnection or error event seems to be firing, the subsequent messages are simply dropped.The first message that goes out generates these logs on the client:
The next one looks like this:
Notably, the second log sequence does not contain
flushing 1 packets in socket
which I assume means that the message is just being queued up and is never going out. Why would that be?