<html><head></head><body>and there might be better examples, that's just what I found usefull.<br><br><div class="gmail_quote">On December 13, 2017 10:17:17 AM GMT+01:00, Ian Badcoe <ian_badcoe@yahoo.co.uk> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div>Hi Jonas,</div><div><br /></div><div>Do you have a link to ENET_wrapper.hpp?  Searching I can find variations on that name, but no an exact match.</div><div><br /></div><div>I can also find projects that describe themselves as enet wrappers, but which don't contain a file of that name (and I don't want to set off with a random project if there is some recommended source that would be better for me...)</div><div><br /></div><div>Thanks again,</div><div><br /></div><div>Ian<br /></div><div><br /></div>
            <div><br /></div><div><br /></div>
            
            <div id="ydp2f21d135yahoo_quoted_4128470312" class="ydp2f21d135yahoo_quoted">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                    
                    <div>
                        On Tuesday, 12 December 2017, 18:01:51 GMT, Jonas Beck <ninnghazad@dnophos.de> wrote:
                    </div>
                    <div><br /></div>
                    <div><br /></div>
                    <div><div id="ydp2f21d135yiv2449581990"><div>1,2,3: yes<br clear="none" />
try simple enet-only example code same machine.<br clear="none" />
bonus: search for ENET_wrapper.hpp for nice c++ example.<br clear="none" /><br clear="none" /><div class="ydp2f21d135yiv2449581990yqt5225388783" id="ydp2f21d135yiv2449581990yqt03196"><div class="ydp2f21d135yiv2449581990gmail_quote">On December 12, 2017 5:08:35 PM GMT+01:00, Ian Badcoe <ian_badcoe@yahoo.co.uk> wrote:<blockquote class="ydp2f21d135yiv2449581990gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;">
<div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div>Hi,</div><div><br clear="none" /></div><div>I'm trying to create a prototype game using enet for networked play.</div><div><br clear="none" /></div><div>I am creating the host and client very similarly to what is shown in the tutorial, but I cannot get the client to connect to the server.  So far, this is all on the same machine...  A client should be able to find a server on the same machine, shouldn't it?</div><div><br clear="none" /></div><div>I have tried adjusting the port and address settings in many different ways in an attempt to make it work but everything fails the same way, e.g. the "enet_host_service" call that I make after "enet_host_connet" times out without generating any event.</div><div><br clear="none" /></div><div>My code is quite large (because I have integrated enet into the existing non-networked codebase) but what is done with enet is pretty simple (and even simpler during this initial phase...)</div><div><br clear="none" /></div><div>The host was created like this:</div><div><br clear="none" /></div><div>    ENetAddress address;<br clear="none" /><br clear="none" />    address.host = ENET_HOST_ANY;<br clear="none" />    address.port = 1234;<br clear="none" />    _data->_enet_host = enet_host_create(<br clear="none" />        &address,<br clear="none" />        32,<br clear="none" />        2,<br clear="none" /><div>        0, 0);</div><div><br clear="none" /></div><div>and then goes into a loop which calls enet_host_service continually:</div><div><br clear="none" /></div><div>        int ret = enet_host_service(_data->_enet_host, &event, 5);<br clear="none" /><br clear="none" /><div>-----<br clear="none" /></div><div><br clear="none" /></div><div>The client was created like this:</div><div><br clear="none" /></div><div>    _data->_enet_host = enet_host_create(<br clear="none" />        NULL,<br clear="none" />        1,<br clear="none" />        2,<br clear="none" />        0, 0);<br clear="none" /><br clear="none" />    if (!_data->_enet_host)<br clear="none" />    {<br clear="none" />        ...<br clear="none" />    }<br clear="none" /><br clear="none" />    int ret;<br clear="none" />    ENetAddress address;<br clear="none" />    address.host = ENET_HOST_BROADCAST;<br clear="none" />    address.port = _data->_port;<br clear="none" /><br clear="none" />    _data->_enet_peer = enet_host_connect(_data->_enet_host, &address, 1, 0);<br clear="none" /><br clear="none" />    if (_data->_enet_peer == NULL)<br clear="none" />    {<br clear="none" />        ...<br clear="none" />    }<br clear="none" /><br clear="none" />    ENetEvent event;<br clear="none" /><br clear="none" />    ret = enet_host_service(_data->_enet_host, &event, 5000);<br clear="none" /><br clear="none" /><div>    if (ret > 0 && event.type == ENET_EVENT_TYPE_CONNECT)</div><div>    {</div><div>        ... <- we never get here and "ret" is always zero<br clear="none" /></div><div>    }<br clear="none" /></div><div><br clear="none" /></div><div>-----</div><div><br clear="none" /></div><div>I have tried a lot of possibilities for the address and port settings, addresses including:</div><div><br clear="none" /></div><div>127.0.0.1</div><div>ENET_HOST_ANY  (host)<br clear="none" /></div><div>ENET_HOST_BROADCAST  (client)<br clear="none" /></div><div>local ip<br clear="none" /></div><div><br clear="none" /></div><div>and various ports such as 55555 or 5432</div><div><br clear="none" /></div><div>but nothing seems to work.  I am compiling for x64 on windows using VC2017.  Enet is running in its own thread, and I have been careful with a critical_section for the parts that need it, but the program is not getting far enough to reach any thread<->thread issues yet...  </div><div><br clear="none" /></div><div>My problem is I don't know where the problem might lie:</div><div><br clear="none" /></div><div>1) can Enet work on a single machine?</div><div>2) can ENET_HOST_BROADCAST work on a single machine?</div><div>3) can it be network settings / firewall (I doubt this since in the past I have done a lot of general client server work from VMs hosted on this same machine without any difficulty...)</div><div><br clear="none" /></div><div>I basically need some hint on where to look for the problem...  Does Enet have some sort of verbose mode that will log problems to the debug stream?</div><div><br clear="none" /></div><div>Thanks for any help, I did try looking in the mail-list archives but my problem is not really knowing what to search for...</div><div><br clear="none" /></div><div>Later I will try again at home, which should eliminate network/firewalls as a possibility...</div><div><br clear="none" /></div><div>Thanks again,</div><div><br clear="none" /></div><div>Ian<br clear="none" /></div><br clear="none" /></div></div><br clear="none" /><br clear="none" /></div></div></blockquote></div></div></div></div><div class="ydp2f21d135yqt5225388783" id="ydp2f21d135yqt06927">_______________________________________________<br clear="none" />ENet-discuss mailing list<br clear="none" /><a shape="rect" href="mailto:ENet-discuss@cubik.org" rel="nofollow" target="_blank">ENet-discuss@cubik.org</a><br clear="none" /><a shape="rect" href="http://lists.cubik.org/mailman/listinfo/enet-discuss" rel="nofollow" target="_blank">http://lists.cubik.org/mailman/listinfo/enet-discuss</a><br clear="none" /></div></div>
                </div>
            </div></div></blockquote></div></body></html>