Skip to content

Commit dd3c325

Browse files
authored
Merge pull request #292 from clue-labs/unneeded-nonblock
Avoid unneeded syscall on socket close
2 parents ccca668 + fe9999d commit dd3c325

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Connection.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,9 @@ public function handleClose()
127127
}
128128

129129
// Try to cleanly shut down socket and ignore any errors in case other
130-
// side already closed. Shutting down may return to blocking mode on
131-
// some legacy versions, so reset to non-blocking just in case before
132-
// continuing to close the socket resource.
133-
// Underlying Stream implementation will take care of closing file
134-
// handle, so we otherwise keep this open here.
130+
// side already closed. Underlying Stream implementation will take care
131+
// of closing stream resource, so we otherwise keep this open here.
135132
@\stream_socket_shutdown($this->stream, \STREAM_SHUT_RDWR);
136-
\stream_set_blocking($this->stream, false);
137133
}
138134

139135
public function getRemoteAddress()

0 commit comments

Comments
 (0)