<div>How it is now if it's an error event.type() will return 'none' however I have tested it and no errors are being created (as far as I can tell.)  I updated the code a little, still nothing good.</div><div>I did find one more thing though.  The client is printing that it connected 1 client-service before the server prints that a client connected, and only on the next client-service it connects on the server, and then the next server-service segfaults.</div>

<div><br></div><div>Does enet do anything at all with peer->data?</div><div><br></div><div>Here is the whole server/client code (wrapped in Python, but it segfaults when using C++ also.)</div><div>I know it would be easier to debug if I remade everything step by step from scratch, though I'm afraid I would arrive at the same place without a visible explanation.  I will do that if we cannot figure this out.</div>

<div><br></div><div>Server:</div><div><div><font class="Apple-style-span" face="'courier new', monospace">from scge import *</font></div><div><font class="Apple-style-span" face="'courier new', monospace">from time import *</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">serv = server() #defaults to localhost:2000</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">while True:</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">      </span>e = serv.service()</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">     </span>if e.type() == 'disconnect':</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">           </span>print('Someone disconnected.')</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">     </span>elif e.type() == 'connect':</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">            </span>print('Someone connected.')</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space:pre">     </span>elif e.type() == 'receive':</font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-tab-span" style="white-space: pre; ">         </span>print('received')</font></div>

</div><div><font class="Apple-style-span" face="'courier new', monospace"><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-tab-span" style="white-space: pre; "> </span></font></div>

<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: 'courier new', monospace; "><span class="Apple-tab-span" style="white-space: pre; ">     </span>sleep(.2)</span></div>

<div><span class="Apple-style-span" style="font-family: 'courier new', monospace; "><br></span></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Client:</font></div><div><span class="Apple-tab-span" style="white-space: pre; "></span><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="white-space: pre;">from scge import *
from time import *

cli = client()
cli.connect()

window(160, 120)

while window_opened():
        e = cli.service()

        if e.type() == 'connect':
                print('Connected.')
        
        swap()
        sleep(.01)</span></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font><div class="gmail_quote">On Wed, Apr 27, 2011 at 4:45 PM, Jay Sprenkle <span dir="ltr"><<a href="mailto:jsprenkle@gmail.com">jsprenkle@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">If enet returns an error you don't change e.evt.peer->data and you don't return an error code.<div>The code that calls this method has no way to detect if this happens.</div>

<div>It will blindly use that value when it may not be correct.</div><div><div></div><div class="h5">
<div><br><br><div class="gmail_quote">On Wed, Apr 27, 2011 at 3:34 PM, Jacob F. <span dir="ltr"><<a href="mailto:queatz@gmail.com" target="_blank">queatz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Both the server and client are created without an error, and I can receive the data placed into e.evt.peer->data after I set it.  Are there any specific errors that I should check for?<div><br></div></blockquote></div>



</div>
</div></div><br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
<a 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></div>