Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 8.0.1
-
Fix Version/s: None
-
Component/s: NIO
-
Labels:None
-
Number of attachments :
Description
When using Safari, sending several messages through a websocket will lead to some of them not getting through right away. The last few messages often don't arrive until another message is sent later through the websocket to flush them out.
To reproduce, put this in Safari's debug console:
var x = new WebSocket('ws://localhost:8080/conn/')
for(i in [1, 2, 3, 4, 5]) x.send('x')
If you put a breakpoint in the onMessage method of your WebSocket.OnTextMessage handler, it will only get triggered twice, when it should have been triggered 5 times.
If in Safari you then type:
x.send('x')
The remaining messages will all come through and trigger the breakpoint another 4 times.
A look at WireShark suggests that Safari is in fact sending the messages, but for whatever reason they aren't propagating up into the WebSocket servlet. I traced the bug into the code and discovered that even if I put a breakpoint at SelectChannelEndPoint.schedule, it still wasn't being called for the missing messages, so it must be somewhere even farther down than that.