Is SO_SNDTIMEO valid for small time intervals under kernel 2.4?

Posted on 2006-04-11
Last Modified: 2008-02-26

I continuously sent 1.5K udp packet over 1Gbps interface using blocking i/o. I also set  SO_SNDTIMEO as 50us and measured the time before and after writev().

it seems so_sndtimeo does not work, and i constantly got 300us delay (due to the busy sendind loop...)

any insight is highly appreciated...
Question by:adairwu
    LVL 43

    Accepted Solution

    50us is 50 microseconds? 50/1000000 fraction of second (right?)
    Considering that linux clock is ticking 100 per second (1000 times in kernel 2.6 - but confugureable) the resolution You should expect is 1ms (milisecond)...
    same applies to usleep()
    LVL 3

    Assisted Solution

    this is interesting...

    I definitely recall strange experiences with this years ago...

    Rich Stevens didn't mention it in his books, his a response he wrote in google groups:
    From:            W. Richard Stevens - view profile
    Date:            Fri, Mar 21 1997 12:00 am
    Email:    (W. Richard Stevens)
    Groups:             comp.unix.solaris
    Not yet rated
    show options

    Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse | Find messages by this author

    > Does anyone know what type of argument setsockopt expects when you set
    > SO_SNDTIMEO/SO_RCVTIMEO? The man pages make no mention of these. The two
    > options I have seen in other OS's are struct timeval or an integer.

    A pointer to a struct timeval.  But I don't think Solaris implements
    these socket options.  Just because the SO_xxx constant is defined in
    a header does not mean it's implemented ...

            Rich Stevens

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now