|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
44 - 35 = ?
Subscribe to this entry?

 [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: Fri Feb 23 03:01:30 2024 UTC