开发者

BSD-Socket Options explanation needed

I want detailed explanations for bsd-socket options so that I开发者_Go百科 can use them in the right manner. Can anybody please provide me some document or link from where I can refer?

Thanks, Satinder Singh Khera.satinder@rediffmail.com


Beej's Guide to Network Programming an excellent place to start looking.

If you're talking specifically about get/setsockopt, Beej says this. He further notes that get/setsockopt is often OS-dependent, in which case consult your man page, MSDN, or whatever.


Here is the list from http://www.sockets.com

Value       Type        Meaning
--------------- --------------- -----------------------------------------------
SO_BROADCAST    BOOL        Allow transmission of broadcast messages on the
                socket.

SO_DEBUG    BOOL        Record debugging information.  

SO_DONTLINGER   BOOL        Don't block close waiting for unsent data to be
                sent.  Setting this option is equivalent to
                setting SO_LINGER with l_onoff set to
                zero.

SO_DONTROUTE    BOOL        Don't route: send directly to interface.

SO_KEEPALIVE    BOOL        Send keepalives

SO_LINGER   struct linger   Linger on close if unsent data is present
        FAR *

SO_OOBINLINE    BOOL        Receive out-of-band data in the normal data
                stream.  

SO_RCVBUF   int     Specify buffer size for receives

SO_REUSEADDR    BOOL        Allow the socket to be bound to an address
                which is already in use.  (See bind().)

SO_SNDBUF   int     Specify buffer size for sends

TCP_NODELAY BOOL        Disables the Nagle algorithm for send
                coalascing.

SO_ACCEPTCON    BOOL        Socket is listening

SO_ERROR    int     Get error status and clear

SO_RCVLOWAT int     Receive low water mark

SO_RCVTIMEO int     Receive timeout

SO_SNDLOWAT int     Send low water mark

SO_SNDTIMEO int     Send timeout

SO_TYPE     int     Type of the socket

IP_OPTIONS          Set options field in IP header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜