walkor@qq答復(fù):
在worker里面添加代碼:
$address = $this->getRemoteAddress();
Gateway模型 Event.php 里面調(diào)用 $_SERVER $_SERVER
正確
如果是在繼承了Man\Core\SocketWorker的worker類里面(例如BusinessWorker.php Gateway.php等)使用 $this->getRemoteAddress();
如果是gateway模型,在Event.php中直接使用 $_SERVER $_SERVER