<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I investigated a bit and looks like
      enet_create_host SOMETIMES fails in enet_socket_bind with errno
      message:<br>
      "Can't assign requested address"<br>
      I am passing empty string (but not null) as ip and ports in range
      12345-12445. If I use 127.0.0.1 as ip, it fails in bind socket
      with "Address already in use"<br>
      <br>
      still investigating ;)<br>
      <br>
      <br>
      <br>
      On 18/09/2012 16:53, Martin Zemblowski wrote:<br>
    </div>
    <blockquote cite="mid:50589909.4050901@bigheadgames.co.uk"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">NAT part is covered by gamespy, i get
        two addresses of machines involved. then i try to create host
        (not peer!) on mac and it fails sometimes (question: why?). if
        it succeeds, then we go to making connections business ;)<br>
        Regards!<br>
        <br>
        On 18/09/2012 16:40, Daniel Aquino wrote:<br>
      </div>
      <blockquote
cite="mid:CACRDGdmgSJ9Pi53VWTVT0T=fDS=JcPKNLiDhZUOS0yrNpnYdJg@mail.gmail.com"
        type="cite">Both hosts should try to send to one another at the
        same time from/to predefined ports.<br>
        <br>
        <a moz-do-not-send="true"
          href="https://en.wikipedia.org/wiki/UDP_hole_punching">https://en.wikipedia.org/wiki/UDP_hole_punching</a><br>
        <br>
        <br>
        <br>
        <br>
        <div class="gmail_quote">On Tue, Sep 18, 2012 at 11:24 AM,
          Martin Zemblowski <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:martin@bigheadgames.co.uk" target="_blank">martin@bigheadgames.co.uk</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>gamespy transport service is using udp. <br>
                right now one of the player creates socket and just
                listens to it, another on is actively trying to connect
                to other party, but fails at create_host for some
                reasons. I am creating host in the same way on both
                machines.<br>
                <br>
                I am testing connectivity on the same machines
                constantly, so I dont see any reason why it should work
                for 3 times in a row and then wouldnt... and it's a bit
                weird moment - creating host, i would expect it to fail
                when actually trying to connect<br>
                :(
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    On 18/09/2012 16:16, Daniel Aquino wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">Is gamespy using tcp or udp ?<br>
                    <br>
                    If both your players try to connect at the same time
                    then they should get through after a retry or two.<br>
                    <br>
                    Although there is many types of nat's so it might
                    not always work.<br>
                    <br>
                    <br>
                    <br>
                    <div class="gmail_quote">On Tue, Sep 18, 2012 at
                      10:37 AM, Martin Zemblowski <span dir="ltr"><<a
                          moz-do-not-send="true"
                          href="mailto:martin@bigheadgames.co.uk"
                          target="_blank">martin@bigheadgames.co.uk</a>></span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div>
                          <div>
                            <div bgcolor="#FFFFFF" text="#000000">
                              <div
                                style="font-family:-moz-fixed;font-size:14px"
                                lang="x-western">Hello! <br>
                                I am using enet library in conjunction
                                with gamespy. I use gamespy to create
                                socket, connect to lobby, select
                                opponent and do the NAT punch-through.
                                In next step I close gamespy socket,
                                initialize enet library and try to
                                create enet host with same port (in my
                                case I pass ip as empty string) and then
                                start connection to other party. It
                                works, but not always. I am using three
                                computers right now: pc vista, pc xp and
                                mac osx 10.7.4. On mac sometimes (not
                                always) I cannot create enet host (even
                                if i try to create host with different
                                ports, 100 retries), here's the code: <br>
                                <br>
                                retries = 101; <br>
                                enet_address_set_host
                                (&enet.gAddress, ip); <br>
                                do    { <br>
                                    enet.gAddress.port = port; <br>
                                    enet.gHost = enet_host_create
                                (&enet.gAddress , 1 , 2, 0 ,0 ); <br>
                                <br>
                                    if (enet.gHost == NULL) <br>
                                    { <br>
                                        printf ( "An error occurred
                                while trying to create an ENet
                                host(%s:%d).\n",ip,port); <br>
                                        port++; // HACK <br>
                                    } <br>
                                    else <br>
                                        printf( "host created.\n"); <br>
                                    } while (enet.gHost == NULL
                                && (--retries > 0)); <br>
                                <br>
                                Any ideas? <br>
                                Thank you! <br>
                                Martin <br>
                                <br>
                              </div>
                            </div>
                          </div>
                        </div>
                        <br>
                        _______________________________________________<br>
                        ENet-discuss mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:ENet-discuss@cubik.org"
                          target="_blank">ENet-discuss@cubik.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://lists.cubik.org/mailman/listinfo/enet-discuss"
                          target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
                        <br>
                      </blockquote>
                    </div>
                    <br>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
ENet-discuss mailing list
<a moz-do-not-send="true" href="mailto:ENet-discuss@cubik.org" target="_blank">ENet-discuss@cubik.org</a>
<a moz-do-not-send="true" href="http://lists.cubik.org/mailman/listinfo/enet-discuss" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            ENet-discuss mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.cubik.org/mailman/listinfo/enet-discuss"
              target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
ENet-discuss mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a>
<a moz-do-not-send="true" 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>
      <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>