|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55841 stream_socket_accept() warnings
Submitted: 2011-10-04 09:33 UTC Modified: 2018-05-05 21:25 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: aco dot best at gmail dot com Assigned:
Status: Not a bug Package: Streams related
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: aco dot best at gmail dot com
New email:
PHP Version: OS:


 [2011-10-04 09:33 UTC] aco dot best at gmail dot com
Hello, i have websocket server written using php cli and libevent. It
has master - childs(forks) architecture. Аll forks listening to single
port, and trying to accept incomming connection by stream_socket_accept().
But only one fork will accept single connection others will get a
warning. To suppress this warning iam using @. But unfortunately
warning still goes into set_error_handler callback. Such kind of
warning, cause performance penalty in this case.
I can see a few way how it can be solved inside php:
1. by removing this warning
2. by adding forth argument to the function call, to place error inside it
3. by creating function like stream_last_error
4. or any other appropriate way
It would be nice, if it will be solved,
Thank you.
Best, regards
Ivan Shalganov


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-05 21:25 UTC]
-Status: Open +Status: Not a bug
 [2018-05-05 21:25 UTC]
A bit late, but

No no no. Address the problem of multiple children listening, not the symptoms of unwanted warning messages!
Only the master should be listening on the main port, and it forks the child only after it accepts a new connection. If you want to keep a preforking architecture like you kinda have now then then you need a mutex to restrict listening access to one idle child.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 27 01:01:28 2024 UTC