1. closesocket (typically does not close immediately and undergoes a time_wait process) wants to continue reusing the socket:BOOL breuseaddr=true;setsockopt (S,sol_socket, SO_REUSEADDR, (const char*) &breuseaddr,sizeof (BOOL));
2. If the soket that
Int setsockopt (Socket s,Int level,Int optname,Const char * optval,Int optlen);
S (socket): point to an open set of interface descriptive wordsLevel: (level): Specifies the option code type.Sol_socket: basic set of interfacesIpproto_ip: IPv4
Int setsockopt (Socket s,Int level,Int optname,Const char * optval,Int optlen);
S (socket): point to an open set Interface DescriptionLevel: (level): Specifies the option code type.Sol_socket: basic set of interfacesIpproto_ip: IPv4 InterfaceIpproto_
Int setsockopt (Socket s,Int level,Int optname,Const char * optval,Int optlen);
S (socket): point to an open set of interface descriptive wordsLevel: (level): Specifies the option code type.Sol_socket: basic set of interfacesIpproto_ip: IPv4
Setsockopt () usage (parameter description) recv, send timeout processing, setsockoptrecv
Source: recv send blocking and non-blocking
Int setsockopt (SOCKET s,Int level,Int optname,Const char * optval,Int optlen);
S (socket): point to an open set
int setsockopt (SOCKET S,int level,int optname,Const char* Optval,int Optlen);S (socket): points to an open set of interface descriptor wordsLevel: Specifies the type of the option code.Sol_socket: Basic set of interfacesIpproto_ip:ipv4 Socket
1, setsockopt () Role and introductionThe socket is not withdrawn immediately after it is closed, but it is going through a time_wait phase. The port is now re-bound to an error. To bind the port immediately, you need to set the SO_REUSEADDR
int setsockopt (SOCKET S,int level,int optname,Const char* Optval,int Optlen);S (socket):Level: Specifies the type of the option code.Sol_socket: Basic set of interfacesIpproto_ip:ipv4 Socket ConnectorIpproto_ipv6:ipv6 Socket
Setsockopt-socket detailed usage-C ++ paradise-C ++ blog
Setsockopt
1.Closesocket (usually does not close immediately and goes through the time_wait process) and wants to continue to reuse the socket:Bool breuseaddr = true;Setsockopt(S,
Transferred from: http://blog.csdn.net/zhonglinzhang/article/details/9183229Function Description:Gets or sets the options associated with a socket. Options may exist in multi-tier protocols , and they will always appear on the topmost socket layer.
1.Closesocket (usually does not close immediately and goes through the time_wait process) and wants to continue to reuse the socket:Bool breuseaddr = true;Setsockopt(S, sol_socket, so_reuseaddr, (const char *) & breuseaddr, sizeof (bool ));
2.If
Description of functional descriptions:Gets or sets the options associated with a socket. Options may exist in multi-tier protocols, and they always come out of the top sockets Layer today. When you manipulate socket options, the options are located
Analysis: setsockopt ()
1. IfAfter the socket in the established State (usually distinguished by the port number and the flag) calls closesocket (usually it will not be immediately closed but will go through the time_wait process), you want to
Linux below getsockopt/setsockopt function description
Function Description:Gets or sets the options associated with a socket. Options may exist in multi-tier protocols, and they always appear on the topmost sockets layer. When you manipulate
Function Description:Gets or sets the options associated with a socket. Options may exist in multi-tier protocols, and they will always appear on the topmost socket layer. When you manipulate socket options, the options are located at the layer and
The article has
Http://hi.baidu.com/chary8088/blog/item/a47bfbd1c01d4fd6562c843f.html
This format is intolerable !!!!
The following format is displayed after I open it in advanced editing mode.
Change to the normal mode, or the following format,
Linux below getsockopt/setsockopt function description
"Getsockopt/setsockopt system call"Function Description:Gets or sets the options associated with a socket. Options may exist in multi-tier protocols, and they always appear on the
Function: Sets the set of interfaces created by the socket to be detailed on the properties.int setsockopt (SOCKET S,int level,int optname,Const char* Optval,int Optlen);S (socket): points to an open set of interface descriptor wordsLevel: Specifies
1. If the socket is already in the established State (usually distinguished by the port number and flag ),Closesocket (usually does not close immediately and goes through the time_wait process) and wants to continue to reuse the socket:Bool
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.