|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49416 Add stream_socket_listen() and stream_socket_set_option() functions
Submitted: 2009-08-30 14:27 UTC Modified: 2010-12-29 13:18 UTC
Avg. Score:4.7 ± 0.5
Reproduced:2 of 3 (66.7%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kak dot serpom dot po dot yaitsam at gmail dot com Assigned:
Status: Open Package: Streams related
PHP Version: * OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-08-30 14:27 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
Please, add function stream_socket_listen(resource,backlog): 
it should call listen() for the socket created by 
stream_socket_server beforehand.

I need to use stream_socket_server but I can not use socket_*,
because of libevent.

Also, it would be nice to have a stream_socket_set_option function,
which allows to apply SO_REUSE and other parameters.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-29 13:18 UTC]
-Package: Feature/Change Request +Package: Streams related -Operating System: any +Operating System: * -PHP Version: 5.3.0 +PHP Version: *
 [2010-12-29 13:18 UTC]
-Summary: stream_socket_listen() and stream_socket_set_option() functions. +Summary: Add stream_socket_listen() and stream_socket_set_option() functions
 [2014-07-15 16:32 UTC]
I can't get how libevent would change anything on your problem. Could you elaborate please, knowing PHP wont use such a layer internally anyway ?

Also, I would strongly recommand you to use ext/socket.
ext/socket is a very thin wrapper over OS's socket capabilities, whereas stream_ suffer from a much more complex layer.
For example, for socket low level option, such as SO_REUSE , ext/socket is much more suitable.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 11:01:34 2024 UTC