コード例 #1
0
 public function listen($port)
 {
     printf("# server listened at {$port}\n");
     uv_tcp_nodelay($this->server, 1);
     uv_tcp_bind($this->server, uv_ip4_addr("0.0.0.0", $port));
     uv_listen($this->server, 511, array($this, "onConnect"));
     uv_run(uv_default_loop());
 }
コード例 #2
0
ファイル: http.php プロジェクト: zhanglei/php-uv
 public function listen($port)
 {
     uv_tcp_nodelay($this->server, 1);
     uv_tcp_bind6($this->server, uv_ip6_addr("::1", $port));
     uv_listen($this->server, 511, array($this, "onConnect"));
     uv_run(uv_default_loop());
 }