Re: Re: fopen never ends?

From: Date: Wed, 20 Feb 2008 05:18:33 +0000
Subject: Re: Re: fopen never ends?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-269687@lists.php.net to get a copy of this message
Paul van Brouwershaven wrote:
Nathan Rixham wrote:
I don't think this is a php problem, just load the url up in a browser and you'll see the same, appears to be a misconfigured server at the otherside - probably confused about not being passed a name based "host" header in the request.
I know that my browser is also waiting a long time, but strange that there is no timeout in fopen? My scripts are getting stuck and eventually they will hang my server. (when I start a new job every x minutes)
Perhaps concider moving to fsockopen or stream_socket_client with timeout parameters to solve your issue.
fsockopen has no context and with stream_socket_client I have no timeout but stream_context_get_options is not returning the right data $options = stream_context_get_options($fp);
Check out the first "Note:" section on this page. http://us3.php.net/manual/en/function.stream-socket-client.php First thing it tells you is that you can set a timeout for the connection using stream_set_timeout(). I know this can be done. I am running a PHP daemon that that acts as both a server and a client. Jim Lucas

« previous php.general (#269687) next »