<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="gmail_quote">On Fri, Mar 29, 2013 at 9:43 AM, Syed Setia Pernama <span dir="ltr"><<a href="mailto:syedhs@yahoo.com" target="_blank">syedhs@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_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 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><br clear="all"><br>-- <br><i style="font-size:12px;font-family:Verdana,Helvetica,sans-serif"><a href="http://xkcd.com/1156/" target="_blank">http://xkcd.com/1156/</a></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>