示例#1
0
 /**
  * Accepts a client connection from the server instance.
  *
  * @param ServerInterface $server
  * @return ClientInterface
  */
 public function accept(ServerInterface $server)
 {
     $this->server = $server;
     \uv_accept($server->getBackend(), $this->connection);
     $this->running = true;
     return $this;
 }
示例#2
0
 /**
  * Binds a server on the current socket
  *
  * @param ServerInterface $server
  * @return SocketInterface
  */
 public function bind(ServerInterface $server)
 {
     \uv_tcp_bind($server->getBackend(), $this->getBackend());
     return $this;
 }