Click to See Complete Forum and Search --> : How to measure the time between the client and server buffers??
Hi,
i did a client and server programm, and i want to measure the time between the client buffer when i send the socket and the server buffer when i just receive the socket from the client without counting the time for reading or writing the the date file from or to the disk(buffer).
olivier
May 18th, 1999, 11:00 AM
you can send the time_t into the formatting of the buffer
the client will send : "915148800 - My Text"
The server will receive the text, an extract the client time from the text
it will get then the system time with the function time () and do a diff the time that is in the buffer
Hi,
I dont understand what you say, could you explain it clearly with some c code, please
Thanks
olivier
May 19th, 1999, 03:18 AM
Client :
sprintf (MyBuf, "%ld - This is a client message", time (NULL));
=>Send MyBut to the Server
Server:
=>Read on the Socket a Buffer like "915148800 - This is a client message"
=>You have to get the number in a variable which represent the time when the client sent the message
=>Then you just have to the difference between the actual time and the client time
Hi,
but the internal clock in the two computers are different, so how can you do to synchronise them.
Thks ( you can write in french)
olivier
May 19th, 1999, 09:52 AM
Quand ton client se connecte au serveur, il note l'heure de connection.
Le serveur lui envoie tout de suite son heure.
Tu fais la difference des deux et tu sais quel est le delta que doit ajouter ou retirer à l'heure du client
pour te synchroniser au serveur
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.