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_
From: http://lydnkj.bokee.com/viewdiary.10417372.html
Getsockopt and setsockopt
Obtain the set Interface Options:
Code:
Int getsockopt (INT sockfd, int level, int optname, void * optval, socklen_t * opteln) sets the set of Interface Options:Int
In the PHP development work very much uses the time-out processing to the time-out situation, I say several scenes:
1. Get data asynchronously if a backend data source gets unsuccessful then skips without affecting the entire page presentation
2.
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
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
This article will mainly introduce the receiving process of the request in Nginx, including the parsing of the request header and the reading process of the request body.
First, introduce the HTTP request basic format defined in rfc2616:
In PHP development, I often use timeout processing to timeout. I will talk about several scenarios, it is convenient for users who need to work in PHP development to use timeout handling to timeout. I will talk about several scenarios:
1.
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
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): point to an open set Interface DescriptionLevel: (level): Specifies the option code type.Sol_socket: basic set of interfacesIpproto_ip: IPv4 InterfaceIpproto_
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.