File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,12 +16,14 @@ class Connection extends Stream implements ConnectionInterface
1616{
1717 public function handleClose ()
1818 {
19- if (is_resource ($ this ->stream )) {
20- // http://chat.stackoverflow.com/transcript/message/7727858#7727858
21- stream_socket_shutdown ($ this ->stream , STREAM_SHUT_RDWR );
22- stream_set_blocking ($ this ->stream , false );
23- fclose ($ this ->stream );
19+ if (!is_resource ($ this ->stream )) {
20+ return ;
2421 }
22+
23+ // http://chat.stackoverflow.com/transcript/message/7727858#7727858
24+ stream_socket_shutdown ($ this ->stream , STREAM_SHUT_RDWR );
25+ stream_set_blocking ($ this ->stream , false );
26+ fclose ($ this ->stream );
2527 }
2628
2729 public function getRemoteAddress ()
Original file line number Diff line number Diff line change @@ -141,11 +141,13 @@ public function getPort()
141141
142142 public function shutdown ()
143143 {
144- if (is_resource ($ this ->master )) {
145- $ this ->loop ->removeStream ($ this ->master );
146- fclose ($ this ->master );
147- $ this ->removeAllListeners ();
144+ if (!is_resource ($ this ->master )) {
145+ return ;
148146 }
147+
148+ $ this ->loop ->removeStream ($ this ->master );
149+ fclose ($ this ->master );
150+ $ this ->removeAllListeners ();
149151 }
150152
151153 public function createConnection ($ socket )
You can’t perform that action at this time.
0 commit comments