Attempt to read from messages.

@return void
426441
public function read()
    {
        $read = $this->getStreams();
        $write = null;
        $except = null;
        $modified = stream_select($read, $write, $except, 0, 200000);

        if ($modified === false) {
            throw new \RuntimeException("stream_select() returned an error");
        }

        foreach ($read as $resource) {
            foreach ($this->messages as $message) {
                $this->readResource($message, $resource);
            }
        }
    }
324397
protected function saveMessage()
    {
        $this->savedMessage = ['headers' => []];
        $this->savedMessage['body'] = $this->getBody();
        $this->savedMessage['children'] = $this->getChildren();
        if (count($this->savedMessage['children']) > 0 && '' != $this->getBody()) {
            $this->setChildren(array_merge([$this->becomeMimePart()], $this->savedMessage['children']));
            $this->setBody('');
        }
    }
332182
public function process()
    {
        $msgs = $this->getMessages();
        foreach ($msgs as $aMsg) {
            $this->logger->debug(
                '------ Received: ------ ' . "\n" . $aMsg . "\n\n"
            );
            $resPos = strpos($aMsg, 'Response:');
            $evePos = strpos($aMsg, 'Event:');
            if (($resPos !== false) &&
              (($resPos < $evePos) || $evePos === false)
            ) {
                $response = $this->messageToResponse($aMsg);
                $this->incomingQueue[$response->getActionId()] = $response;
            } elseif ($evePos !== false) {
                $event = $this->messageToEvent($aMsg);
                $response = $this->findResponse($event);
                if ($response === false || $response->isComplete()) {
                    $this->dispatch($event);
                } else {
                    $response->addEvent($event);
                }
            } else {
                // broken ami.. sending a response with events without
                // Event and ActionId
                $bMsg = 'Event: ResponseEvent' . "\r\n";
                $bMsg .= 'ActionId: ' . $this->lastActionId . "\r\n" . $aMsg;
                $event = $this->messageToEvent($bMsg);
                $response = $this->findResponse($event);
                $response->addEvent($event);
            }
            $this->logger->debug('----------------');
        }
    }
1149922
protected function _loadSavedMessages() {
        $session = Mage::getSingleton('turpentine/session');
        foreach ($session->loadMessages($this->getNameInLayout()) as $msg) {
            parent::addMessage($msg);
        }
        $this->_clearMessages();
    }
572471
private function update_error_messages() {

		$this->logger or $this->logger = ( new Error\ErrorLoggerFactory() )->get_logger();
		$this->logger->log_error( $this->get_error_code(), $this->get_input_data() );
		$this->messages[] = $this->logger->get_last_message();
	}
220620
public function messagesHandled()
    {
        $callback = $this->payload->get('callback_query');

        if ($callback !== null) {
            $callback['message']['chat']['id'];
            $this->removeInlineKeyboard($callback['message']['chat']['id'],
                $callback['message']['message_id']);
        }
    }
719725
protected function onRead()
    {
        start:
        if ($this->state === static::STATE_STANDBY) { // outside of packet
            while (($l = $this->readline()) !== null) {
                if ($l === '') {
                    continue;
                }
                $char = $l{0};
                $val = mb_orig_substr($l, 1);
                if ($char === ':') { // inline integer
                    $this->pushValue((int)$val);
                    goto start;
                } elseif (($char === '+') || ($char === '-')) { // inline string
                    $this->error = $char === '-';
                    $this->pushValue($val);
                    goto start;
                } elseif ($char === '*') { // defines number of elements of incoming array
                    $length = (int)$val;
                    if ($length <= 0) {
                        $this->pushValue([]);
                        goto start;
                    }

                    $ptr = [];

                    if (is_array($this->ptr)) {
                        $this->ptr[] =& $ptr;
                    }

                    $this->ptr =& $ptr;
                    $this->stack[] = [&$ptr, $length];
                    $this->levelLength = $length;
                    unset($ptr);

                    goto start;
                } elseif ($char === '$') { // defines size of the data block
                    if ($l{1} === '-') {
                        $this->pushValue(null);
                        goto start;
                    }
                    $this->valueLength = (int)$val;
                    if ($this->valueLength + 2 > $this->pool->maxAllowedPacket) {
                        $this->log('max-allowed-packet (' . $this->pool->config->maxallowedpacket->getHumanValue() . ') exceed, aborting connection');
                        $this->finish();
                        return;
                    }
                    $this->setWatermark($this->valueLength + 2);
                    $this->state = static::STATE_BINARY; // binary data block
                    break; // stop reading line-by-line
                }
            }
        }

        if ($this->state === static::STATE_BINARY) { // inside of binary data block
            if ($this->getInputLength() < $this->valueLength + 2) {
                return; //we do not have a whole packet
            }
            $value = $this->read($this->valueLength);
            if ($this->read(2) !== $this->EOL) {
                $this->finish();
                return;
            }
            $this->state = static::STATE_STANDBY;
            $this->setWatermark(3);
            $this->pushValue($value);
            goto start;
        }
    }
1170759
private function read()
    {
        $filePath = $this->getFilePath();
        $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : [];

        $this->loadSession();
    }
24280
protected function read() {
        while ($this->currentPosition < $this->codeLength) {
            $startPosition = $this->currentPosition;
            $currentChar = $this->code{$this->currentPosition};
            if (in_array($currentChar, $this->whitespaces)) {
                $this->readWhitespace();
            } else {
                switch ($currentChar) {
                    case '/': {
                        $this->readSlash();
                        break;
                    }
                    case '#': {
                        $this->readDirective();
                        break;
                    }
                    case '"': {
                        $this->readString();
                        break;
                    }
                }
            }

            // Force any progress in the loop
            if ($this->currentPosition === $startPosition) {
                $this->compressedCode .= $currentChar;
                ++$this->currentPosition;
            }
        }
    }
925748
async def _read_messages(self):
        
        while not self._stopped and self._websocket is not None:
            async for message in self._websocket:
                if message.type == aiohttp.WSMsgType.TEXT:
                    payload = message.json()
                    event = payload.pop("type", "Unknown")
                    self._dispatch_event(event, data=payload)
                elif message.type == aiohttp.WSMsgType.ERROR:
                    break
591987
public function read_message()
  {
    $message = "";
    while (true) {
      socket_recv ( $this->socket , $buf , 4 , MSG_WAITALL );
      if ($buf == null)
        return $buf;
      $frame_size = unpack("Nsize", $buf);
      $frame_size = $frame_size["size"];
      if ($frame_size == 0)
        return $message;
      
      socket_recv ( $this->socket , $buf , $frame_size , MSG_WAITALL );
      $message .= $buf;
    }
    
    return $message;
  }
658941
public function read()
    {
        try {
            $this->stack->markAsRead(from_route('type', 'notifications'));
            return new JsonResponse('', 200);
        } catch (Exception $ex) {
            Log::alert($ex);
            return new JsonResponse(['message' => trans('antares/notifications::messages.sidebar.unable_to_mark_notifications_as_read')], 500);
        }
    }
1155865
protected function loadMessages()
    {
        $messageText = '';
        if (! $this->payload instanceof Collection) {
            $messageText = $this->event->get('text');
            if ($this->isSlashCommand()) {
                $messageText = $this->event->get('command').' '.$messageText;
            }
        }

        $user_id = $this->event->get('user');
        if ($this->event->has('user_id')) {
            $user_id = $this->event->get('user_id');
        }

        $channel_id = $this->event->get('channel');
        if ($this->event->has('channel_id')) {
            $channel_id = $this->event->get('channel_id');
        }

        $message = new IncomingMessage($messageText, $user_id, $channel_id, $this->event);
        $message->setIsFromBot($this->isBot());

        $this->messages = [$message];
    }
755881
protected function decode(): void
    {
        $error = false;

        if (empty($this->expression)) {
            return;
        }

        if (is_numeric($this->expression)) {
            $this->expression = $this->integerToString($this->expression);
        }

        try {
            $this->decodeIntervalSpec();
        } catch (Exception $e) {
            $error = true;
        }

        if ($error) {
            $error = false;
            try {
                $this->decodeTimeString();
            } catch (Exception $e) {
                $error = true;
            }

            // last resort
            if ($error) {
                $error = false;
                if ($this->decodeRegexString() === false) {
                    $error = true;
                }
            }
        }

        if ($error) {
            throw new Exception(__CLASS__.': Invalid time expression');
        }
    }
630785
protected function readToBuffer()
    {
        $this->ThrowOnConnectionInvalid();
        $message = stream_socket_recvfrom($this->connection, 1024, 0, $peer);
        //$message = fread($conn,1024);
        if ($message !== '' && $message !== false) {
            $this->buffer->pushData($message);
            foreach ($this->buffer->getMessages() as $messageData) {
                $messageData = unserialize($messageData);
                $this->emit('message', array($this, $messageData));
            }
        } else {
            $this->close();
        }
    }
707527
protected function readFromSession()
    {
        if (is_array($this->session->get(self::SESSION_KEY))) {
            $this->messages = $this->session->get(self::SESSION_KEY);
        }
        return $this;
    }
1295906
public function read_message()
  {
    socket_recv ( $this->socket , $buf , 8 , MSG_WAITALL );
    if ($buf == null)
      return $buf;
    
    $frame_count = unpack("Nserial/Ncount", $buf);
    $frame_count = $frame_count["count"];
    $message = "";
    for ($i = 0; $i < $frame_count; $i++ ) {
      socket_recv ( $this->socket , $buf , 4 , MSG_WAITALL );
      $frame_size = unpack("Nsize", $buf);
      $frame_size = $frame_size["size"];
      if ($frame_size > 0) {
        socket_recv ( $this->socket , $bif , $frame_size , MSG_WAITALL );
        $message .= $bif;
      }
      
    }
    return $message;
  }