   checking the ping?
  hey, i am using winsock tcp socket, and i need to know the ping for some client-server movement calculations.i didnt realy notice any function that does that. is there one?i thought of using the function that gets time miliseconds passed since windows started, then immedialy sending a packet, recieving at client side and immediatly sending back, get the miliseconds that passed since windows started again. substract and divide by two. but is this a good way to do this? is there a better way? heck is there actually a function that does that for me?thanks :) yours, Bru.   
Quote:Original post by Bruhey, i am using winsock tcp socket, and i need to know the ping for some client-server movement calculations.i didnt realy notice any function that does that. is there one?i thought of using the function that gets time miliseconds passed since windows started, then immedialy sending a packet, recieving at client side and immediatly sending back, get the miliseconds that passed since windows started again. substract and divide by two. but is this a good way to do this? is there a better way? heck is there actually a function that does that for me?thanks :) yours, Bru.There's no built in function for this, no. The best way of doing it is just as you described. You don't even need to send the time in the packet, just note the time that a ping packet was sent, and then check the time the ping-reply packet was received.You can even do this implicity - if there's any packets you send that require a response (A move ACK for instance), then you can treat them as ping packets.You'll need to keep a unique ID in each packet, so you know what packet the move-ACK refers to, but I imagine you'll have something like that already.   ;Quote:Original post by Evil SteveQuote:Original post by Bruhey, i am using winsock tcp socket, and i need to know the ping for some client-server movement calculations.i didnt realy notice any function that does that. is there one?i thought of using the function that gets time miliseconds passed since windows started, then immedialy sending a packet, recieving at client side and immediatly sending back, get the miliseconds that passed since windows started again. substract and divide by two. but is this a good way to do this? is there a better way? heck is there actually a function that does that for me?thanks :) yours, Bru.There's no built in function for this, no. The best way of doing it is just as you described. You don't even need to send the time in the packet, just note the time that a ping packet was sent, and then check the time the ping-reply packet was received.You can even do this implicity - if there's any packets you send that require a response (A move ACK for instance), then you can treat them as ping packets.You'll need to keep a unique ID in each packet, so you know what packet the move-ACK refers to, but I imagine you'll have something like that already.i didnt think of using double way packets as also ping packets, that's a good idea. thanks Evil Steve the awesome :)   