<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.2">
</HEAD>
<BODY LINK="#0000ff">
Hello Rahul,<BR>
<BR>
Received. I'll you know something,<BR>
<BR>
Best Regards,<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
    Hello Francis,<BR>
    <BR>
     <BR>
    <BR>
    My test scenario just hit the condition. The connection however got broken with the following error message:<BR>
    <BR>
     <BR>
    <BR>
    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)<BR>
    <BR>
     <BR>
    <BR>
    Since the number of bytes read was not printed, I am guessing it was 1. <BR>
    <BR>
    The receive call did not actually fail but possibly delivered 1 byte.<BR>
    <BR>
     <BR>
    <BR>
    Regards,<BR>
    <BR>
     <BR>
    <BR>
    Rahul<BR>
    <BR>
     <BR>
    <BR>
     <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <B>From:</B> Kale, Rahul <BR>
    <B>Sent:</B> Friday, April 22, 2016 10:04 AM<BR>
    <B>To:</B> 'francis.brosnan@aspl.es'<BR>
    <B>Cc:</B> nopoll@lists.aspl.es<BR>
    <B>Subject:</B> RE: Fixed -- Re: [noPoll] Websocket disconnect issues<BR>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
     <BR>
    <BR>
    Hello,<BR>
    <BR>
     <BR>
    <BR>
    I am currently running the test scenario but the failure condition has not happened yet<BR>
    <BR>
    in the first 12 hours. Sometimes it takes 2-3 days to reproduce. I will let you<BR>
    <BR>
    know when it happens next.<BR>
    <BR>
     <BR>
    <BR>
    Besides the SSL twist, even for plain TCP connection I believe this situation can occur.<BR>
    <BR>
    Due to maximum transmission unit (MTU) limitations the sender can break up messages<BR>
    <BR>
    at arbitrary byte boundaries. If the receiver is slow to read, or if the network<BR>
    <BR>
    bandwidth is limited, a fast sender will accumulate data to send. It will send<BR>
    <BR>
    piled up data (multiple websocket messages in our case) in chunks of MTU size<BR>
    <BR>
    and end up breaking messages at arbitrary byte boundaries.<BR>
    <BR>
     <BR>
    <BR>
    You are totally correct in saying that the OS will not deliver bytes collected<BR>
    <BR>
    from the wire to user space in a broken fashion. But the OS on the sender can put the<BR>
    <BR>
    bytes on the wire in arbitrary pieces (TCP segments) depending on transient network conditions, <BR>
    <BR>
    acks received, TCP sliding window size, round trip time, MTU size etc. <BR>
    <BR>
    I am no expert at this, but the few TCP protocols I have implemented I have always had to account for this<BR>
    <BR>
    before the application achieved 24/7 reliability.  For non-blocking sockets this is not trivial to achieve.<BR>
    <BR>
    For blocking sockets, it is much easier.<BR>
    <BR>
     <BR>
    <BR>
    I am glad that you are considering fixing this properly. It will make the nopoll<BR>
    <BR>
    library more robust for everyone :)<BR>
    <BR>
     <BR>
    <BR>
     <BR>
    <BR>
    Thanks,<BR>
    <BR>
     <BR>
    <BR>
    Rahul<BR>
    <BR>
     <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <B>From:</B> Francis Brosnan Blázquez [<A HREF="mailto:francis.brosnan@aspl.es">mailto:francis.brosnan@aspl.es</A>] <BR>
    <B>Sent:</B> Friday, April 22, 2016 5:52 AM<BR>
    <B>To:</B> Kale, Rahul<BR>
    <B>Cc:</B> <A HREF="mailto:nopoll@lists.aspl.es">nopoll@lists.aspl.es</A><BR>
    <B>Subject:</B> Re: Fixed -- Re: [noPoll] Websocket disconnect issues<BR>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
     <BR>
    <BR>
    Hi Raul,<BR>
    <BR>
    It is going to take us a bit to deeply resolve the issue and<BR>
    more precisely, to support websockets peers sending byte<BR>
    by byte important parts of the headers that should be received<BR>
    at once...<BR>
    <BR>
    In any case, I was wondering if you did have time to check<BR>
    latest modifications... did them resolve the issue? Is it more<BR>
    stable your test case?<BR>
    <BR>
    Please, let us know how the latest changes performs in your<BR>
    scenario,<BR>
    <BR>
    Best Regards,<BR>
    <BR>
    <BR>
    <BR>
    Hello,<BR>
    <BR>
    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.<BR>
    <BR>
    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.<BR>
    <BR>
    I really appreciate your efforts in chasing these issues and fixing them promptly.<BR>
    <BR>
    Regards,<BR>
    <BR>
    Rahul<BR>
    <BR>
    <BR>
    <BR>
    <BR>
    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>><BR>
    <BR>
     <BR>
    <BR>
    <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
 
-- 
Francis Brosnan Blázquez - ASPL
91 134 14 22 - 91 134 14 45 - 91 116 07 57
 
<A HREF="http://aspl.es">http://aspl.es</A>
<A HREF="http://asplhosting.com">http://asplhosting.com</A>
<A HREF="http://twitter.com/aspl_es">http://twitter.com/aspl_es</A>
<A HREF="http://twitter.com/asplhosting">http://twitter.com/asplhosting</A>
 
AVISO LEGAL
 
Este mensaje se dirige exclusivamente a su destinatario. Los datos
incluidos en el presente correo son confidenciales y sometidos a secreto
profesional, se prohíbe divulgarlos, en virtud de las leyes vigentes. Si
usted no lo es y lo ha recibido por error o tiene conocimiento del mismo
por cualquier motivo, le rogamos que nos lo comunique por este medio y
proceda a destruirlo o borrarlo.
 
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL). No obstante, usted puede ejercitar sus derechos de acceso,
rectificación, cancelación y oposición dispuestos en la mencionada Ley
Orgánica, notificándolo por escrito a:
ASPL - Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de
Henares (Madrid).
</PRE>
</TD>
</TR>
</TABLE>
    <BR>
     <BR>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    This message is subject to the following terms and conditions: <A HREF="http://www.barco.com/en/maildisclaimer">MAIL DISCLAIMER</A> 
<PRE>
_______________________________________________
noPoll mailing list
<A HREF="mailto:noPoll@lists.aspl.es">noPoll@lists.aspl.es</A>
<A HREF="http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll">http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Francis Brosnan Blázquez  -  ASPL
<A HREF="http://www.asplhosting.com/">http://www.asplhosting.com/</A>
<A HREF="http://www.aspl.es/">http://www.aspl.es/</A>
<A HREF="https://twitter.com/aspl_es">https://twitter.com/aspl_es</A>
<A HREF="https://twitter.com/asplhosting">https://twitter.com/asplhosting</A>
<A HREF="https://twitter.com/francisbrosnanb">https://twitter.com/francisbrosnanb</A>

91 134 14 22 - 91 134 14 45 - 91 116 07 57

AVISO LEGAL
 
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL).
 
ASPL garantiza que los datos serán tratados con la finalidad de mantener
las oportunas relaciones comerciales o promocionales con usted o la
entidad que usted representa. No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y oposición dispuestos en
la mencionada Ley Orgánica, notificándolo por escrito a ASPL -
Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de Henares
(Madrid).


</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>