示例#1
0
 /**
  * Create a Websocket server.
  *
  * @param   \Hoa\Socket\Server  $server    Server.
  * @param   \Hoa\Http\Request   $request   Request parser.
  * @return  void
  * @throws  \Hoa\Socket\Exception
  */
 public function __construct(Socket\Server $server, Http\Request $request = null)
 {
     parent::__construct($server);
     if (null === $request) {
         $request = new Http\Request();
     }
     $this->setRequest($request);
     return;
 }
示例#2
0
 /**
  * Override the parent run() method to open the connection.
  *
  * @return  void
  */
 public function run()
 {
     $this->connect();
     return parent::run();
 }