public function read(ByteBuffer $destinationBuffer)
 {
     $length = $destinationBuffer->remaining();
     $data = $this->socket->recv($length);
     $destinationBuffer->put($data);
     return strlen($data);
 }
Exemple #2
0
 public function recvFrom(Socket $socket)
 {
     $data = $socket->recv();
     if (!$socket instanceof self) {
         $data = $this->decode($data);
     }
     return $data;
 }