示例#1
0
 /**
  * @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);
     }
 }
示例#2
0
文件: Version.php 项目: khelle/surume
 /**
  * @param IoConnectionInterface $conn
  * @param string $message
  */
 public function wsMessage(IoConnectionInterface $conn, IoMessageInterface $message)
 {
     $this->onMessage($conn, $message->read());
 }