Skip to content

Commit 2fa74a2

Browse files
committed
Use fwrite() for connected sockets
1 parent 1ea1569 commit 2fa74a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Datagram/Socket.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ public function getHost()
4242
public function send($data, $target = null)
4343
{
4444
if ($target === null) {
45-
$target = $this->address;
45+
fwrite($this->socket, $data);
46+
} else {
47+
stream_socket_sendto($this->socket, $data, 0, $target);
4648
}
47-
stream_socket_sendto($this->socket, $data, 0, $target);
4849
}
4950

5051

0 commit comments

Comments
 (0)