SO_RCVWAKEUP & SO_SNDWAKEUP

Joel Sherrill joel.sherrill at OARcorp.com
Tue Sep 30 15:50:06 UTC 2003


Rolf Schroedter wrote:

> Seems I need some clarification on the SO_RCVWAKEUP & SO_SNDWAKEUP
> callbacks:
> 
> SO_RCVWAKEUP:
> Will it be called once when data arrives or repeatedly when
> data is available ? E.g. What happens, if the application
> doesn't read *all* available data from the socket, but leaves
> some bytes in the input queue ? Will there be a 2nd SO_RCVWAKEUP
> callback ?
> 
> SO_SNDWAKEUP:
> Will I have exactly one callback after each write() call,
> or repeated callbacks whenever there is space available
> in the output buffer ?
> 
> IMO that's important to know to avoid application deadlocks.

Here is the page in the networking guide that describes it.

http://www.rtems.com/onlinedocs/rtems-doc-20030417/share/rtems/html/networking/networking00029.html

My reading of the code in rtems_glue.c is that there would be
one call per updating of the buffers when a task is blocked.
It may require a task multiple reads on the socket to actually
get all of the data out of the buffer and you would not see
those.  But the task would not block on the reads satisfied from
buffered data.

FWIW I didn't write this code and am just analyzing the code
in cpukit/libnetworking/rtems/rtems_glue.c and
cpukit/libnetworking/kern/uipc_socket.c to come up with this.
So I could easily be wrong.

> Thanks,
> Rolf.
> 
> ---------------------------------------------------------------
> Rolf Schroedter
> German Aerospace Center
> 
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985




More information about the users mailing list