Boost logo

Boost Users :

From: Aljaz (aljaz.fajmut_at_[hidden])
Date: 2008-03-04 17:47:59


Hello

I'm developing server and client applications and I need ping-pong mechanism
to get ping time betwen them (time needed for data to arrive)..

I've been thinking the best way would be to send
Code:
boost::posix_time::microsec_clock::universal_time()from server to client,
which would then just reply with its own universal_time() ..

The first problem is I dont know how to store universal_time() as an
int/long.. I know I can store it as a string but this would take extra cpu
to parse the data each time (with boost posix library)..

All the data I send is serialized - maybe I could just serialize the
Code:
boost::posix_time::ptimeobject and send over?

The next thing is what if server's time zone is gmt+1 and client's gmt+3?
Will that affect the the time if I do the subtraction to get the ping time?
If so, what can I do about it?

Maybe anyone has better solution in mind?

Thanks a lot for help


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net