|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #30386 STREAM_CLIENT_ASYNC_CONNECT not working
Submitted: 2004-10-10 23:49 UTC Modified: 2004-10-11 16:46 UTC
From: vnegrier at esds dot com Assigned: nlopess (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.0.2 OS: Linux 2.4
Private report: No CVE-ID: None
 [2004-10-10 23:49 UTC] vnegrier at esds dot com
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://", $errno, $errstr, 10, STREAM_CLIENT_ASYNC_CONNECT);

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-11 01:20 UTC]
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.

 [2004-10-11 16:46 UTC]
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

 [2020-02-07 06:11 UTC]
Automatic comment on behalf of nlopess
Log: fix #30386: missing STREAM_CLIENT_CONNECT flag description
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 00:03:36 2021 UTC