Linux Socket Programming by Example - Warren Gay


Setting the SO_OOBINLINE Option

The topic of out-of-band data will be covered in Chapter 14, "Out-of-Band Data." Here, you can just note that in some circumstances limited amounts of data can be expedited ahead of data that might already be sent. Normally, this out-of-band data is received using a different method from the usual data receiving functions. There are times, however, when it is preferred to receive this out-of-band data in the normal manner. When this method is chosen, the out-of-band data arrives ahead of the normal data as part of the normal data stream.

To enable this feature, you could use the following code:

#define TRUE    1
#define FALSE   0

int z;  /* Status code */
int s;     /* Socket s */
int so_oobinline;

so_oobinline = TRUE;

z = setsockopt(s,
    sizeof so_oobinline);

if ( z )


After the option SO_OOBINLINE has been enabled, the out-of-band data will be received with the normal data. In this manner, the out-of-band data received is indistinguishable from the normal data.


Index terms contained in this section

            SO_OOBINLINE socket option 2nd
out-of-band data
     SO_OOBINLINE socket option
            code example
            setting 2nd
     socket options
            SO_OOBINLINE 2nd
SO_OOBINLINE socket option
      code example
      setting 2nd
            SO_OOBINLINE 2nd