diff --git a/src/Socket.php b/src/Socket.php index 4039b98..ef380a4 100644 --- a/src/Socket.php +++ b/src/Socket.php @@ -64,7 +64,7 @@ public function resume() public function onReceive() { try { - $data = $this->handleReceive($peer); + list($data, $peer) = $this->handleReceive(); } catch (Exception $e) { // emit error message and local socket @@ -111,7 +111,7 @@ private function sanitizeAddress($address) return $address; } - protected function handleReceive(&$peerAddress) + protected function handleReceive() { $data = stream_socket_recvfrom($this->socket, $this->bufferSize, 0, $peerAddress); @@ -125,7 +125,7 @@ protected function handleReceive(&$peerAddress) $peerAddress = $this->sanitizeAddress($peerAddress); - return $data; + return array($data, $peerAddress); } protected function handleClose()