note 33512 added to function.socket-connect
| From: | w at rack1 dot php dot net | Date: | Sat, 28 Jun 2003 07:20:53 +0000 |
| Subject: | note 33512 added to function.socket-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51130@lists.php.net to get a copy of this message | ||
man page for connect :
EINPROGRESS
The socket is non-blocking and the connection cannot be completed immediately. It is possible to
select(2) or poll(2) for completion by selecting the socket for writing. After select indicates
writability, use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to determine
whether connect completed successfully (SO_ERROR is zero) or unsuccessfully (SO_ERROR is one of the
usual error codes listed here, explaining the reason for the failure).
use socket_getoption($socket,SOL_SOCKET,SO_ERROR) . If you get value 115, it is connecting. If you
get value different than 115 and 0, that means that an error has occured (see what error with
socket_strerror()).
However, I don't know how does that works under Windows, maybe it wont work at all. It is
supposed to work under Linux (man pages said that).
----
Manual Page -- http://www.php.net/manual/en/function.socket-connect.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33512
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33512&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33512&report=yes