ID:               30386
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vnegrier at esds dot com
 Status:           Open
-Bug Type:         Sockets related
+Bug Type:         Documentation problem
 Operating System: Linux 2.4
 PHP Version:      5.0.2
 New Comment:

You need to use STREAM_CLIENT_ASYNC_CONNECT|STREAM_CLIENT_CONNECT for
the flags parameter.

STREAM_CLIENT_CONNECT is the default flag value which means "perform
the connect() syscall".  STREAM_CLIENT_ASYNC_CONNECT is a modifier for
this which means "when connect() is called, do it async"

Making this a documentation problem.



Previous Comments:
------------------------------------------------------------------------

[2004-10-10 23:49:06] vnegrier at esds dot com

Description:
------------
when I use the STREAM_CLIENT_ASYNC_CONNECT flag to my
stream_socket_client() call, it just doesn't connect() at all.

Reproduce code:
---------------
<?
echo "trying ...\n";
stream_socket_client("tcp://127.0.0.1:80", $errno, $errstr, 10,
STREAM_CLIENT_ASYNC_CONNECT);
sleep(10);
?>

Actual result:
--------------
using strace on the following script gives :

--------------------------------------------
write(1, "trying ...\n", 11trying ...
)            = 11
rt_sigprocmask(SIG_BLOCK, [CHLD], [RTMIN], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
nanosleep({10, 0}, {10, 0})             = 0
--------------------------------------------

in other words the connect() syscall is never called at all between the
echo and sleep.

on the other hand, when I remove STREAM_CLIENT_ASYNC_CONNECT, connect()
is called.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30386&edit=1

Reply via email to