/** {@inheritdoc} */
 public function read(FramePickerInterface $picker, Context $context, $isOutOfBand)
 {
     stream_socket_recvfrom($this->socket->getStreamResource(), self::SOCKET_BUFFER_SIZE, STREAM_PEEK, $remoteAddress);
     if (!$remoteAddress && !$this->isLocalIo) {
         stream_socket_recvfrom($this->socket->getStreamResource(), self::SOCKET_BUFFER_SIZE);
         throw new AcceptException($this->socket, 'Can not accept client: failed to receive remote address.');
     }
     $reader = new DatagramClientIo($this->socket, $this->isLocalIo ? null : $remoteAddress);
     return new AcceptedFrame($remoteAddress, new UdpClientSocket($this->socket, $remoteAddress, $reader->read(new RawFramePicker(), $context, $isOutOfBand)));
 }
 /**
  * Constructor
  *
  * @param SocketInterface $socket Socket object
  * @param string          $remoteAddress Destination address in form scheme://host:port
  * @param string          $data Datagram for this socket
  */
 public function __construct(SocketInterface $socket, $remoteAddress, $data)
 {
     parent::__construct($socket, $remoteAddress);
     $this->data = (string) $data;
 }