<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>The ENet ping is indeed very slow to
stabilize.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>What I do (even though I do use the ENet ping here &
there) is to add a 'server time' to each outgoing server packet. One of my
commands to clients is an explicit ping, which is sent out now & then. The
client responds with the same server time (pseudocode):</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Server:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> pkt.cmd=PING;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> pkt.time=serverTime;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> sendpacket();</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Client:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> read(pkt);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> if(pkt.cmd==PING)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> {</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> sendToServer(pkt);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> }</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Server:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> read(pkt)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> if(pkt.cmd==PING)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> {</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>
pingTime=serverTime-pkt.time;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2> }</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>You can send these periodically to keep ping time uptodate
(add more code to deal with jittering ping times now & then). In the
beginning, when trying to figure out ping time, you can increase the number of
pings going out the machine. Actually, I use an accumulator for the ping time
which moves towards a sort of average, so you need a bunch of
packets.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Fortunately, in my game I have a small period of
inactiveness at the start where the ping time (my ping packets) can settle down
nicely.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2>Ruud</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=484174310-11012010><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=nl dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Van:</B> enet-discuss-bounces@cubik.org
[mailto:enet-discuss-bounces@cubik.org] <B>Namens </B>Uj<BR><B>Verzonden:</B>
Monday, January 11, 2010 11:15<BR><B>Aan:</B> Discussion of the ENet
library<BR><B>Onderwerp:</B> [ENet-discuss] When is the ping stable
?<BR></FONT><BR></DIV>
<DIV></DIV>Hi all,<BR>I agree with Ruud :-)<BR><BR>I changed the subject
because another question came to my mind (and I dont want to interfere with
Jay's topic).<BR>How do you guys know when the ping is "stable" ?<BR><BR>At
connection the ping starts with a default value and then converge to the right
value.<BR>Do you know some tricks to obtain the more accurate ping possible in
a given time ?<BR><BR>I'd like one peer to be able to map all ping values in a
mesh network and use those values as soon as possible.<BR>So maybe I could set
up a mechanism where everyone is sending its ping values with other peers when
he knows those values are stable.<BR>Did anyone already implement something
like this ?<BR><BR>Thanks by advance for your help,<BR>best
regards,<BR>Julien<BR><BR><BR><BR>
<DIV class=gmail_quote>On Mon, Jan 11, 2010 at 10:37 AM, Ruud van Gaal <SPAN
dir=ltr><<A href="mailto:ruud@racer.nl"
target=_blank>ruud@racer.nl</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Isn't
the ping time more important? In that case, keep ping times on the server
(probably already done by ENet, search the ENetPeer class) and get the list
from the server ordered by ping.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>I
wouldn't say the distance in computers is of much use for most
situations.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
size=2>Ruud</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,255) 2px solid; MARGIN-RIGHT: 0px">
<DIV lang=nl dir=ltr align=left>
<HR>
<FONT face=Tahoma size=2><B>Van:</B> <A
href="mailto:enet-discuss-bounces@cubik.org"
target=_blank>enet-discuss-bounces@cubik.org</A> [mailto:<A
href="mailto:enet-discuss-bounces@cubik.org"
target=_blank>enet-discuss-bounces@cubik.org</A>] <B>Namens </B>Jay
Sprenkle<BR><B>Verzonden:</B> Sunday, January 10, 2010
20:09<BR><B>Aan:</B> Discussion of the ENet library<BR><B>Onderwerp:</B>
[ENet-discuss] icmp/tracert/discovering network
topology?<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV>
<DIV></DIV>Good morning,<BR><BR>I'm considering adding some extra features
to my enet based peer to peer application. I'd like the main server to be
smart enough to discover which peers have the shortest connection path to
each other. When a peer requests a list of other peers to connect to then
the server can deliver an optimal list. The only way I could think of to
implement this would be to do a tracert to each peer and sort the list of
peers by what common paths they share. Has anyone done icmp packets with
enet? I know it's not it's intended function but it doesn't seem like it
would be difficult to hack together. If anyone has any better ideas on how
to implement this I'd love to hear them.<BR><BR>Thanks!<BR>Have a good
weekend<BR><BR><BR></DIV></DIV></BLOCKQUOTE></DIV><BR>_______________________________________________<BR>ENet-discuss
mailing list<BR><A href="mailto:ENet-discuss@cubik.org"
target=_blank>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></BLOCKQUOTE></BODY></HTML>