Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.3

Request #2157 socket_shutdown and onShutdown callback
Submitted: 2004-08-18 13:27 UTC
From: ivan at oxylus dot si Assigned: schst
Status: Closed Package: Net_Server
PHP Version: 5.0.0 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2004-08-18 13:27 UTC] ivan at oxylus dot si
Description: ------------ 'Fork' driver does not call onShutdown() callback function. Also, socket_shutdown() is not called prior to socket_close() which prevents client from receiving EOF on the socket stream. This, for instance, blocks the fgets() or fread() call on the client. I propose that we modify the closeConnection() function of the Net/Server/Driver/Fork.php so that it calls socket_shutdown() and also callback onShutdown() prior to exit. I copy/pasted the function code snippet into "Reproduce code". Reproduce code: --------------- function closeConnection() { if (!isset($this->clientFD[0])) { return $this->raiseError( "Connection already has been closed." ); } if (method_exists($this->callbackObj, "onClose")) { $this->callbackObj->onClose($id); } $this->_sendDebugMessage("Closed connection from ".$this->clientInfo[0]["host"]." on port ".$this->clie$ @socket_shutdown($this->clientFD[0], 2); @socket_close($this->clientFD[0]); $this->clientFD[0] = null; unset($this->clientInfo[0]); if (method_exists($this->callbackObj, "onShutdown")) { $this->callbackObj->onShutdown($id); } exit; }

Comments

 [2004-08-18 20:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-08-18 20:49 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!