Skip to content

Commit 8c8c4db

Browse files
Silence a PHP warning on socket close
1 parent 6d31030 commit 8c8c4db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Crusse/JobServer/EventLoop.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,10 @@ private function populateMessageBuffer( $data, MessageBuffer &$buffer ) {
367367

368368
private function closeConnection( $socket ) {
369369

370-
// Close the connection until the worker client sends us a new result
371-
if ( socket_shutdown( $socket, 2 ) )
370+
// Close the connection until the worker client sends us a new result. We
371+
// silence any errors so that we don't have to test the connection status
372+
// before we try to close the socket.
373+
if ( @socket_shutdown( $socket, 2 ) )
372374
$this->log( 'Closed connection' );
373375
}
374376

0 commit comments

Comments
 (0)