<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Not sure I follow, ENet is a layer ontop of UDP/IP, not TCP/IP. <br>
    ENet sends periodic ping packets and if no answer is returned in a
    given time, it timeouts the other end.<br>
    <br>
    The behaviour Soren mentions must be something else, a bug perhaps.<br>
    <br>
    <br>
    On 2012-11-12 16:23, Jay Sprenkle wrote:
    <blockquote
cite="mid:CAG19Bi7NkLP37v-xxi0RyT4GqjDy8u9hwikH82J7ZP-MM9FUuA@mail.gmail.com"
      type="cite">
      <div>I've also seen this behavior while using c# .net code.</div>
      <div><br>
      </div>
      <div>Detecting disconnects is problematic while using tcp/ip
        because of the design.</div>
      <div><br>
      </div>
      <div>Here's what I came up with:</div>
      <div><br>
      </div>
      <div>Send something to the client and if it does not answer within
        a reasonable time then assume it's down or disconnected.</div>
      <div><br>
      </div>
      <div>When you try to connect immediately after another connection
        failed in an indeterminate state it seems to occasionally drop
        you immediately. If this happens retry the connection from the
        client. This seems to recover from the indeterminate state.<br>
        <br>
        <div class="gmail_quote">On Sun, Nov 11, 2012 at 12:59 PM, Soren
          Dreijer <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:dreijer@echobit.com" target="_blank">dreijer@echobit.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div link="blue" vlink="purple" lang="EN-US">
              <div>
                <p class="MsoNormal"><span lang="DA">Hey guys,</span></p>
                <p class="MsoNormal"><span lang="DA"> </span></p>
                <p class="MsoNormal">I’m trying to track down an issue
                  in one of my ENet server daemons. I’m not sure if this
                  is an issue in my code or in ENet’s, but I wanted to
                  put some feelers out to see if any of you have
                  experienced something similar.</p>
                <p class="MsoNormal"> </p>
                <p class="MsoNormal">Basically, what’s happening is that
                  a client fails to connect to the server from time to
                  time. From the client’s perspective, the connection is
                  established successfully and it gets back an
                  ENET_EVENT_TYPE_CONNECT event from ENet. From the
                  server’s perspective, however, an
                  ENET_EVENT_TYPE_CONNECT event is never received, but
                  instead ENET_EVENT_TYPE_DISCONNECT is fired for the
                  new connection.</p>
                <p class="MsoNormal"> </p>
                <p class="MsoNormal">After taking a look at the server
                  log, it appears the following is happening on the
                  server:</p>
                <p class="MsoNormal"> </p>
                <p><span>1.<span style="font:7.0pt "Times New
                      Roman"">       </span></span>The server
                  calls enet_peer_disconnect () with an ENetPeer object
                  to close the connection to a client. </p>
                <p><span>2.<span style="font:7.0pt "Times New
                      Roman"">       </span></span>ENet never
                  fires an ENET_EVENT_TYPE_DISCONNECT event for this.</p>
                <p><span>3.<span style="font:7.0pt "Times New
                      Roman"">       </span></span>When a new (and
                  different) client connects, ENet reuses the other
                  client’s ENetPeer object (the object has the same
                  memory address), but fires ENET_EVENT_TYPE_DISCONNECT
                  rather than ENET_EVENT_TYPE_CONNECT.</p>
                <p class="MsoNormal"> </p>
                <p class="MsoNormal">It’d seem that the ENetPeer object
                  is somehow in a weird state internally in ENet.</p>
                <p class="MsoNormal"> </p>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
ENet-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a>
<a class="moz-txt-link-freetext" href="http://lists.cubik.org/mailman/listinfo/enet-discuss">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>