php.net |  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
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-11 01:20 UTC] wez@php.net
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] nlopess@php.net
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] phpdocbot@php.net
Automatic comment on behalf of nlopess
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=cf05044b8fb3232c113af4a2da8bb77b1d824c57
Log: fix #30386: missing STREAM_CLIENT_CONNECT flag description
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC