防火墙状态OK:
监听端口:2015
$this->socket = socket_create(AF_INET,SOCK_STREAM, SOL_TCP);
socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR,true);
socket_bind($this->socket, 0 , $this->port);
//监听端口
socket_listen($this->socket);
socket_getsockname($this->socket, $ip,$port);
printf("Server Open %s:%d\n",$ip,$port);
ws://127.0.0.1:2015 和 ws://192.168.1.101:2015 都可以创建
使用外网IP会链接超时。