/** * @override */ public function handleMessage(IoConnectionInterface $conn, IoMessageInterface $message) { if ($conn->httpHeadersReceived !== true) { try { if (($request = $this->httpDriver->readRequest($conn->httpBuffer, $message->read())) === null) { return; } } catch (Error $ex) { return $this->close($conn, 413); } catch (Exception $ex) { return $this->close($conn, 413); } $conn->httpHeadersReceived = true; $conn->httpRequest = $request; $this->httpServer->handleConnect($conn); $this->httpServer->handleMessage($conn, $request); } else { $this->httpServer->handleMessage($conn, $message); } }
/** * @param IoConnectionInterface $conn * @param string $message */ public function wsMessage(IoConnectionInterface $conn, IoMessageInterface $message) { $this->onMessage($conn, $message->read()); }