<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel Aquino wrote:
<blockquote
cite="mid:66f0f93e0906171930g57d78967x28c83d173dfa8e56@mail.gmail.com"
type="cite">
<pre wrap="">>From what i know there is no deleting. I believe enet will clean up
the peer after it has told you about the event and you have had a
chance to react. And the connection function will return a new peer
with no way to re-use the existing peer that I know of... Which does
confuse me a bit in the case of attempting to make a new connection
inside of the disconnection event when there is no more peers left...
I don't know if in that case it would still consider that peer as
valid resulting in the inability to form a new connection or if it
would end up using that same peer destroying data inside of it that
you may still need... So I copied any data I needed from the peer
object before making the new connection just in case... I guess
these questions could be solved easily by looking into the enet code
or setting the peer count to 1 and doing some testing...
On Wed, Jun 17, 2009 at 2:47 PM, William Brandt<a class="moz-txt-link-rfc2396E" href="mailto:taekvideo@gmail.com"><taekvideo@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">When a user is disconnected from the server and is reconnecting, do I need
to get a new ENetPeer object (from the enet_host_connect() function), or is
it possible to use the same one to reconnect? Also, if I have to get a new
one, do I need to delete the old one (& how)?
_______________________________________________
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>
<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>
well what I'm doing now seems to be working...<br>
the main problem I was having was that enet_host_connect() was
returning NULL when I tried to reconnect. It seems I had to explicitly
call enet_peer_reset() on the old peer object before I reconnect and
get a new peer object.<br>
</body>
</html>