Re: non blocking fsockopen
| From: | Adam Zey | Date: | Tue, 01 Aug 2006 15:14:18 +0000 |
| Subject: | Re: non blocking fsockopen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239947@lists.php.net to get a copy of this message | ||
clive wrote:
I know in PHP 5 you can use stream_socket_client() and set the flag to STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT which opens the socket in a non blocking mode. in php 4 you can use fsockopen and then set the socket to non blocking. The problem with this is that the fsockopen blocks until it creates the socket or times out. I want to know if there is a replacement for fsockopen that attempts to open a socket, but returns immediately instead of blocking or is there another way to open a socket in a non blocking mode in PHP 4 thanks Clive.Perhaps the socket plugins for PHP4, which should allow similar flexibility to stream_socket_client()? The downside is you'll need the socket module enabled/compiled. Regards, Adam Zey.