Because of this, if we perform a sleep (20) in the server method, the parameter restrictions similar to & quot; connection_timeout & quot ;=& gt; 10 will be powerless. Today we will discuss how to limit the soap client request time. Method 1: The connection_timeout parameter is used to send a request to the soap server using the SoapClient class of php. You can use a connection_timeout parameter to limit the request time of the soap client. Sample Code: connection_timeout parameter $ client = new SoapClient ('http: // localhost/soap_demo/server. php? Wsdl ', array ("trace" => true, "connection_timeout" => 800); note that this parameter only limits the connection time at the network layer. Once you connect, it does not work. Because of this, if we perform a sleep (20) in the server method, the parameter restrictions similar to "connection_timeout" => 10 will be powerless. ========================================================== =, Therefore, we can also restrict php socket. Note that this method limits the connection time in a general sense, regardless of the time consumed by the network layer or application layer. Compared with the first method, its advantages are obvious, but there is also a shortcoming that cannot be ignored. It will affect other code blocks in this script that rely on socket communication (such as remote access to mysql ). ========================================================== = Is curl for post transmission. Curl can limit the time-out. it also limits the connection time in a general sense, regardless of the time consumed by your network layer or application layer. This will not affect other code blocks, but also precisely control the time. I personally think it is the best.
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.