Req #34380 [Com]: need stream equivalent to socket_last_error

From: Date: Wed, 03 May 2023 11:39:33 +0000
Subject: Req #34380 [Com]: need stream equivalent to socket_last_error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244361@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=34380&edit=1 ID: 34380 Comment by: deepkbtayyab at gmail dot com Reported by: jim at centerfuse dot net Summary: need stream equivalent to socket_last_error Status: Open Type: Feature/Change Request Package: Streams related Operating System: FreeBSD PHP Version: 5.0.4 Block user comment: N Private report: N New Comment: Travel Insider Blog are sharing latest news portal about travel, destination, beaches, tourist places, travel spot, travel insider etc. More info to visit: (https://travelinsiderblog.com)github.com Previous Comments: ------------------------------------------------------------------------ [2021-07-27 13:45:34] cmb@php.net Related To: Bug #63793 ------------------------------------------------------------------------ [2014-09-23 20:45:21] ezacks at barracuda dot com Potential solution here for stream_select and stream_socketpair: https://github.com/php/php-src/pull/838 This change preserves errno in posix_globals, allowing posix_get_last_error() to reflect the failure reason. ------------------------------------------------------------------------ [2012-06-06 13:10:54] fxbois at gmail dot com Is there any chance that this request (/bug ?) will be solved. I confirm that it is impossible to write a daemon mixing socker/stream and signals. ------------------------------------------------------------------------ [2009-08-04 20:48:08] jerrywilborn at gmail dot com Just coming along to bump this as well. It would be quite helpful to be able to get the status of a ASYNC stream_socket_client connection without doing a fwrite/fgets-type work around. ------------------------------------------------------------------------ [2009-05-19 09:42:05] andreas at softwaredesign dot se This bug really needs some attention. It seems that as of today, there is no way to tell whether a stream had a real error, or it just got interrupted by a signal. This makes writing PHP daemons managing child processes using proc_open and stream_select virtually impossible when the daemon also needs to be able to intercept signals (as a daemon preferably would). The stream_select *will* get interrupted by signals, and as the bug report states, there is no way to tell if the interruption was because of a signal, or if something really scary happened. This leads us to the one and only horrible solution: ignoring all errors that stream_select returns, as we presume that the system call was just interrupted. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=34380 -- Edit this bug report at https://bugs.php.net/bug.php?id=34380&edit=1

« previous php.bugs (#244361) next »