laravel框架中使用的代碼:
/**
* socket服務(wù)器ID綁定
*/
public function postSocketBind()
{
Gateway::$registerAddress = '127.0.0.1:1238';
$socket_id = \request()->input('client_id');
session()->put("socket_id",$socket_id);
Gateway::bindUid(session('socket_id'), \App\model\user::userInfo()->id);
}
報(bào)下面錯(cuò)誤
stream_socket_client(): unable to connect to tcp://0.0.0.0: (Failed to parse address "0.0.0.0:")
修改代碼 /vendor/workerman/gatewayclient/Gateway.php,這樣就正常了。好像默認(rèn)給不了一個(gè)端口
class Context{
public static $local_port = 1238;
}