<html><head></head>
<body><div>Hi Rahul,</div><div><br></div><div>Just let you know I've pushed some additional changes to noPoll's github (rev 265 )</div><div>that should fix this issue. I've also added additional reg tests (test_31, 32, 33, 34, and 35)</div><div>to simulate different stop/pause conditions and got them all working,</div><div><br></div><div>Let's us know if this fixes your issue,</div><div>Best Regards,</div><div><br></div><blockquote type="cite"><div>Hello Rahul,</div><div><br></div><div>Received. I'll you know something,</div><div><br></div><div>Best Regards,</div><div><br></div><blockquote type="cite"><div>Hello Francis,</div><div><br></div><div> </div><div><br></div><div>My test scenario just hit the condition. The connection however got broken with the following error message:</div><div><br></div><div> </div><div><br></div><div>Failed to get next 2 bytes to read header from the wire, failed to received content, shutting down id=2 the connection, errno=0 (No error)</div><div><br></div><div> </div><div><br></div><div>Since the number of bytes read was not printed, I am guessing it was 1. </div><div><br></div><div>The receive call did not actually fail but possibly delivered 1 byte.</div><div><br></div><div> </div><div><br></div><div>Regards,</div><div><br></div><div> </div><div><br></div><div>Rahul</div><div><br></div><div> </div><div><br></div><div> </div><div><br></div></blockquote><div> </div><div>From: Kale, Rahul </div><div>Sent: Friday, April 22, 2016 10:04 AM</div><div>To: <a href="mailto:'francis.brosnan@aspl.es">'francis.brosnan@aspl.es</a>'</div><div>Cc: <a href="mailto:nopoll@lists.aspl.es">nopoll@lists.aspl.es</a></div><div>Subject: RE: Fixed -- Re: [noPoll] Websocket disconnect issues</div><div><br></div><div><br></div><div> <blockquote type="cite"></blockquote></div><div> </div><div><br></div><div>Hello,</div><div><br></div><div> </div><div><br></div><div>I am currently running the test scenario but the failure condition has not happened yet</div><div><br></div><div>in the first 12 hours. Sometimes it takes 2-3 days to reproduce. I will let you</div><div><br></div><div>know when it happens next.</div><div><br></div><div> </div><div><br></div><div>Besides the SSL twist, even for plain TCP connection I believe this situation can occur.</div><div><br></div><div>Due to maximum transmission unit (MTU) limitations the sender can break up messages</div><div><br></div><div>at arbitrary byte boundaries. If the receiver is slow to read, or if the network</div><div><br></div><div>bandwidth is limited, a fast sender will accumulate data to send. It will send</div><div><br></div><div>piled up data (multiple websocket messages in our case) in chunks of MTU size</div><div><br></div><div>and end up breaking messages at arbitrary byte boundaries.</div><div><br></div><div> </div><div><br></div><div>You are totally correct in saying that the OS will not deliver bytes collected</div><div><br></div><div>from the wire to user space in a broken fashion. But the OS on the sender can put the</div><div><br></div><div>bytes on the wire in arbitrary pieces (TCP segments) depending on transient network conditions, </div><div><br></div><div>acks received, TCP sliding window size, round trip time, MTU size etc. </div><div><br></div><div>I am no expert at this, but the few TCP protocols I have implemented I have always had to account for this</div><div><br></div><div>before the application achieved 24/7 reliability.  For non-blocking sockets this is not trivial to achieve.</div><div><br></div><div>For blocking sockets, it is much easier.</div><div><br></div><div> </div><div><br></div><div>I am glad that you are considering fixing this properly. It will make the nopoll</div><div><br></div><div>library more robust for everyone :)</div><div><br></div><div> </div><div><br></div><div> </div><div><br></div><div>Thanks,</div><div><br></div><div> </div><div><br></div><div>Rahul</div><div><br></div><div> </div><div><br></div><div> <blockquote type="cite"></blockquote></div><div>From: Francis Brosnan Blázquez [mailto:<a href="mailto:francis.brosnan@aspl.es">francis.brosnan@aspl.es</a>] </div><div>Sent: Friday, April 22, 2016 5:52 AM</div><div>To: Kale, Rahul</div><div>Cc: <a href="mailto:nopoll@lists.aspl.es">nopoll@lists.aspl.es</a></div><div>Subject: Re: Fixed -- Re: [noPoll] Websocket disconnect issues</div><div><br></div><div><br></div><div> <blockquote type="cite"></blockquote></div><div> </div><div><br></div><div>Hi Raul,</div><div><br></div><div>It is going to take us a bit to deeply resolve the issue and</div><div>more precisely, to support websockets peers sending byte</div><div>by byte important parts of the headers that should be received</div><div>at once...</div><div><br></div><div>In any case, I was wondering if you did have time to check</div><div>latest modifications... did them resolve the issue? Is it more</div><div>stable your test case?</div><div><br></div><div>Please, let us know how the latest changes performs in your</div><div>scenario,</div><div><br></div><div>Best Regards,</div><div><br></div><div><br></div><div><br></div><div>Hello,</div><div><br></div><div>Thanks very much for your excellent analysis. It is indeed surprising that such a small packet seems to be delivered in chunks occasionally. Perhaps the fact that this is via SSL is compounding the issue. The original websocket provided on the server side is proxied via Apache Webserver which adds an SSL layer.</div><div><br></div><div>I see that the noPoll code is already handling broken headers for the first two bytes and also for 4 bytes of mask. I was assuming that you have already faced similar issues in the past.</div><div><br></div><div>I really appreciate your efforts in chasing these issues and fixing them promptly.</div><div><br></div><div>Regards,</div><div><br></div><div>Rahul</div><div><br></div><div><br></div><div><br></div><div><br></div><div>This message is subject to the following terms and conditions: MAIL DISCLAIMER<<a href="http://www.barco.com/en/maildisclaimer">http://www.barco.com/en/maildisclaimer</a>></div><div><br></div><div> </div><div><br></div><div>  </div><div>-- </div><div>Francis Brosnan Blázquez - ASPL</div><div>91 134 14 22 - 91 134 14 45 - 91 116 07 57</div><div> </div><div><a href="http://aspl.es">http://aspl.es</a></div><div><a href="http://asplhosting.com">http://asplhosting.com</a></div><div><a href="http://twitter.com/aspl_es">http://twitter.com/aspl_es</a></div><div><a href="http://twitter.com/asplhosting">http://twitter.com/asplhosting</a></div><div> </div><div>AVISO LEGAL</div><div> </div><div>Este mensaje se dirige exclusivamente a su destinatario. Los datos</div><div>incluidos en el presente correo son confidenciales y sometidos a secreto</div><div>profesional, se prohíbe divulgarlos, en virtud de las leyes vigentes. Si</div><div>usted no lo es y lo ha recibido por error o tiene conocimiento del mismo</div><div>por cualquier motivo, le rogamos que nos lo comunique por este medio y</div><div>proceda a destruirlo o borrarlo.</div><div> </div><div>En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de</div><div>diciembre, de Protección de Datos de Carácter Personal, le informamos de</div><div>que sus datos de carácter personal, recogidos de fuentes accesibles al</div><div>público o datos que usted nos ha facilitado previamente, proceden de</div><div>bases de datos propiedad de Advanced Software Production Line, S.L.</div><div>(ASPL). No obstante, usted puede ejercitar sus derechos de acceso,</div><div>rectificación, cancelación y oposición dispuestos en la mencionada Ley</div><div>Orgánica, notificándolo por escrito a:</div><div>ASPL - Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de</div><div>Henares (Madrid).</div><div><br></div><div> </div><div><br></div><div><br></div><div> <blockquote type="cite"></blockquote></div><div>This message is subject to the following terms and conditions: MAIL DISCLAIMER</div><div>_______________________________________________</div><div>noPoll mailing list</div><div><a href="mailto:noPoll@lists.aspl.es">noPoll@lists.aspl.es</a></div><div><a href="http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll">http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll</a></div><div> </div><div> </div></blockquote></body></html>