Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:38:52+00:00 2026-06-02T14:38:52+00:00

How can I calculate or estimate the RTT (Round Trip Time) between client and

  • 0

How can I calculate or estimate the RTT (Round Trip Time) between client and server?

A tutorial or sample addressing this can also help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:38:54+00:00Added an answer on June 2, 2026 at 2:38 pm

    Here what I do:

    #include <rpc/rpc.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sys/times.h>
    #include <fcntl.h>
    #include <time.h>
    
    int main(int argc, char *argv[]) {
    
        enum clnt_stat status;
        CLIENT *handle;
        struct timeval t;
        clock_t rtime;
        struct tms dumm;
        int count = 100000;
        int i;
        time_t now;
        char stamp[27];
        int programm;
        int version;
    
        if (argc != 4) {
            printf("Usage: rpcping <host> <program> <version>\n");
            exit(1);
        }
    
        /*
         *   Create Client Handle
         */
        programm = atoi(argv[2]);
        version = atoi(argv[3]);
        handle = clnt_create(argv[1], programm, version, "tcp");
        if (handle == NULL) {
            printf("clnt failed\n");
            exit(1);
        }
    
        /*
         *   use 30 seconds timeout
         */
        t.tv_sec = 30;
        t.tv_usec = 0;
    
        while (1) {
            rtime = times(&dumm);
            for (i = 0; i < count; i++) {
                status = clnt_call(handle, 0, (xdrproc_t) xdr_void,
                    NULL, (xdrproc_t) xdr_void, NULL, t);
    
                if (status == RPC_SUCCESS) { /* NOP */ }
            }
            now = time(NULL);
            ctime_r(&now, stamp);
            stamp[strlen(stamp) - 1] = '\0';
            fprintf(stdout, "[%s]: Speed:  %2.4fs.\n", stamp,
                count / ((double) (times(&dumm) - rtime) / (double) sysconf(_SC_CLK_TCK)));
            fflush(stdout);
        }
    
        clnt_destroy(handle);
    }
    

    I have a multithread version as well

    https://gist.github.com/2401404

    tigran.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can calculate the size of the files in a tarfile in this way:
Can someone explain with an example how we can calculate the time and space
Hi i was wondering if anyone knows how i can calculate the difference between
How can I calculate the number of differences between two NSStrings. Example: NSString 1
I would like to calculate/estimate the amount of time file will take for download.
I want to create some class that can calculate absolute or relative time period.
I want to calculate the current time differences between US/Central timezone and British Summer
I am planning to develop an application that can calculate the limit of an
How can I calculate a point (X,Y) a specified distance away, on a rotated
How can you calculate the following Friday at 3am as a datetime object? Clarification:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.