<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt">No there is no casting, I simply store ENetPeer as it is, and when packet arrives back, I simply compare and they are not equivalent..<br>Probably there is a mistaken within my code, but the code is very simple.. that is the reason why I emailed just in case anyone has ever encountered something similar..<br><div><span><br></span></div><div><br></div>  <div style="font-family: verdana, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Jay Sprenkle <jsprenkle@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Syed Setia Pernama <syedhs@yahoo.com>; Discussion of the ENet library <enet-discuss@cubik.org> <br> <b><span
 style="font-weight: bold;">Sent:</span></b> Sunday, March 31, 2013 11:18 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [ENet-discuss] ENetPeer pointer comparison..<br> </font> </div> <br>
<div id="yiv264964482"><br>If you are using c++ and casting an object to it's base type you will get a different pointer than if you cast the object to the derived type. Both are valid pointers to the same object but can't be compared.<br>
<br><div class="yiv264964482gmail_quote">On Fri, Mar 29, 2013 at 9:43 AM, Syed Setia Pernama <span dir="ltr"><<a rel="nofollow" ymailto="mailto:syedhs@yahoo.com" target="_blank" href="mailto:syedhs@yahoo.com">syedhs@yahoo.com</a>></span> wrote:<br><blockquote class="yiv264964482gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="font-size:10pt;font-family:verdana, helvetica, sans-serif;"><div>Hi,</div><div><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
I am 80% sure nothing wrong is with my code. Here I copy+paste the log:-</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
22:12:48: Pinging peer (pointer=29411384, ip = 10.1.1.10)<br>22:12:48: Pinging peer (pointer=29411764, ip = 10.1.1.30)<br>22:12:48: ID_GENERAL_PING  (pointer=29412144)<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">What happened is I ping (using my own structure) two peers which has ENetPeer pointer address = 29411384 & 29411764. And then the peer is supposed to reply back, and I compare the ENetPeer</div>
<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">stored in ENetEvent, and they are not the same! 29412144 is not the same with both (29411384 & 29411764). What I was hoping is the ENetPeer stored in ENetEvent should equal to either one,</div>
<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">and therefore my code works.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">Question:</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
Can anyone confirm that ENet indeed create a new copy of ENetPeer (not reusing it) for the above case?</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">TIA.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:verdana, helvetica, sans-serif;">
<br></div></div></div><br>_______________________________________________<br>
ENet-discuss mailing list<br>
<a rel="nofollow" ymailto="mailto:ENet-discuss@cubik.org" target="_blank" href="mailto:ENet-discuss@cubik.org">ENet-discuss@cubik.org</a><br>
http://lists.cubik.org/mailman/listinfo/enet-discuss<br>
<br></blockquote></div><br><br clear="all"><br>-- <br><i style="font-size:12px;font-family:Verdana, Helvetica, sans-serif;">http://xkcd.com/1156/</i><br><div><div><font face="Verdana, Helvetica, sans-serif"><span style="font-size:12px;"><i><br>
</i></span></font><div><br></div></div></div>
</div><br><br> </div> </div>  </div></body></html>