我想要详细解释bsd-socket选项,以便我能以正确的方式使用它们。任何人都可以提供一些我可以参考的文件或链接吗?BSD-Socket选项需要说明
感谢, Satinder辛格 [email protected]
我想要详细解释bsd-socket选项,以便我能以正确的方式使用它们。任何人都可以提供一些我可以参考的文件或链接吗?BSD-Socket选项需要说明
感谢, Satinder辛格 [email protected]
Beej's Guide to Network Programming一个很好的地方开始寻找。
如果你正在专门讨论get/setsockopt,Beej说this。他进一步指出get/setsockopt通常取决于操作系统,在这种情况下请查阅您的手册页,MSDN或其他内容。
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.列表