-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Don't increment bytesRead or unrefTimers if socket is paused #31
Conversation
As I understand it, Can you actually provide a test case where data is being dropped? |
Aaaaahhh this doesn't actually solve my problem. I just got lucky and didn't see it for a while. The behavior I'm seeing is that the application code is seeing bytes from the network truncated, at the beginning of a packet, after his buffer gets full. @feross if this gives you any ideas...I'm pulling my hair out... FYI for me the underlying chrome apps code is https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp and I've also pulled in this patch, which fixes one bug: MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp#25 |
e.g. immediately after the call to chrome.sockets.tcp.setPaused() (corresponding to a full receive buffer at 32kb), the next packet will see its first few bytes truncated. |
Maybe it's a bug in Chrome's implementation of |
removing |
cbd7b4a
to
ac93502
Compare
Packets are getting reordered in the presence of TCP Window Full events. Below is a printout of data from wireshark and the datastream my app received from chrome-net:
The pipe symbols are the locations of packet boundaries in the data stream. As you can see, the packets at offset 2920 and 4368 got reordered. Still not sure if this is chrome-net's problem or the underlying TCP library. |
13875e6
to
0737438
Compare
Seems the problems was in |
Thanks for investigating.
On Thu, Mar 2, 2017 at 2:29 PM Bob McElrath ***@***.***> wrote:
Seems the problems was in cordova-plugin-chrome-apps-sockets-tcp calling
readyToRead in its data handler.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHbpiYjeWQLxLajwE2l9kjRGpAqKkjiks5rh0LQgaJpZM4MQG0_>
.
--
Feross
📱Sent from mobile
|
FYI, actual fix for this problem is here: MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp#27 Closing... |
When TCP buffers get full such that
this.push(buffer)
fails, theonReceive
handler will be called again with the same data. But becausechrome-net
increments its buffers and calls_unrefTimer()
anyway, even if the data was not accepted into the stream's buffer.The result is a corrupted data stream, if the sender ever fills your TCP buffer fully and has to back off.
The following patch fixes that.
Also added a couple of missing error codes...