Req #55841 [Opn->Nab]: stream_socket_accept() warnings

From: Date: Sat, 05 May 2018 21:25:55 +0000
Subject: Req #55841 [Opn->Nab]: stream_socket_accept() warnings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215101@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55841&edit=1 ID: 55841 Updated by: requinix@php.net Reported by: aco dot best at gmail dot com Summary: stream_socket_accept() warnings -Status: Open +Status: Not a bug Type: Feature/Change Request Package: Streams related Operating System: * PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. http://www.fmc-modeling.org/category/projects/apache/amp/4_3Multitasking_server.html Previous Comments: ------------------------------------------------------------------------ [2011-10-04 09:33:10] aco dot best at gmail dot com Description: ------------ 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55841&edit=1

« previous php.bugs (#215101) next »