Skip to content

Commit a6ac236

Browse files
committed
Accessing socket address must not report errors accross all PHP versions
1 parent e6adf45 commit a6ac236

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Socket.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,12 @@ public function __construct(LoopInterface $loop, $socket, Buffer $buffer = null)
3636

3737
public function getLocalAddress()
3838
{
39-
if ($this->socket !== false) {
40-
return $this->sanitizeAddress(stream_socket_get_name($this->socket, false));
41-
}
39+
return $this->sanitizeAddress(@stream_socket_get_name($this->socket, false));
4240
}
4341

4442
public function getRemoteAddress()
4543
{
46-
if ($this->socket !== false) {
47-
return $this->sanitizeAddress(stream_socket_get_name($this->socket, true));
48-
}
44+
return $this->sanitizeAddress(@stream_socket_get_name($this->socket, true));
4945
}
5046

5147
public function send($data, $remoteAddress = null)

0 commit comments

Comments
 (0)