CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Guest

    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).



  2. #2
    Join Date
    May 1999
    Location
    Paris, France
    Posts
    216

    Re: How to measure the time between the client and server buffers??

    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


  3. #3
    Guest

    Re: How to measure the time between the client and server buffers??

    Hi,
    I dont understand what you say, could you explain it clearly with some c code, please

    Thanks


  4. #4
    Join Date
    May 1999
    Location
    Paris, France
    Posts
    216

    Re: How to measure the time between the client and server buffers??

    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



  5. #5
    Guest

    Re: How to measure the time between the client and server buffers??

    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)


  6. #6
    Join Date
    May 1999
    Location
    Paris, France
    Posts
    216

    Re: How to measure the time between the client and server buffers??

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured