06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

getsockopt pNA+ <strong>System</strong> <strong>Calls</strong><br />

Socket Level Options<br />

level must be set to SOL_SOCKET for socket level operations. The optname value<br />

can be one of the following:<br />

SO_BROADCAST Allows broadcast datagrams on a socket.<br />

SO_DONTROUTE Indicates that the outgoing messages should not be routed.<br />

Packets directed to unconnected networks are dropped.<br />

SO_ERROR Returns the pending error and clears the error status.<br />

SO_KEEPALIVE Keeps the connection alive by periodically transmitting a<br />

packet over socket s.<br />

SO_LINGER Controls the action taken when unsent messages are queued<br />

on a socket and a close() is executed. If the socket is a<br />

stream socket and SO_LINGER is set (l_onoff set to 1), the<br />

calling task blocks until it can transmit the data or until a<br />

timeout period expires. If SO_LINGER is disabled (l_onoff<br />

set to 0), the socket is deleted immediately. SO_LINGER uses<br />

the linger structure, which is defined as follows:<br />

struct linger {<br />

int l_onoff; /* on/off option */<br />

int l_linger; /* linger time in secs.*/<br />

}<br />

This structure cannot be packed.<br />

SO_OOBINLINE Requests that out-of-band data go into the normal data input<br />

queue as received; it then is accessible with recv()<br />

calls without the MSG_OOB flag.<br />

SO_RCVBUF Adjusts the normal buffer size allocated for a socket input<br />

buffer.<br />

SO_REUSEADDR Indicates that local addresses can be reused in a bind()<br />

call.<br />

SO_REUSEPORT Indicates that local addresses can be reused in a bind()<br />

call. For more information, see section 4.4.3 of the Network<br />

Programming chapter in <strong>pSO<strong>System</strong></strong> <strong>System</strong> Concepts.<br />

SO_SNDBUF Adjusts the normal buffer size allocated for a socket output<br />

buffer.<br />

SO_TYPE Returns the type of socket.<br />

4-18 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!