channel server服務(wù)端
$serverInstance = new Channel\Server($configInfo['channel_server']['host'], $configInfo['channel_server']['port']);
if(!defined('GLOBAL_START'))
{
//設(shè)置debug日志
Worker::$logFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.'channel-server-debug-'.date('Y-m-d').'.log';
//daemon日志
Worker::$stdoutFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.'channel-server'.date('Y-m-d').'.log';
//指定進(jìn)程ID文件,便于后期做監(jiān)控
Worker::$pidFile = ROOT_PATH.'/channel-server.pid';
Worker::runAll();
}
這是服務(wù)端啟動(dòng)截圖
我在Channel/Server.php的onMessage()方法增加了接收消息的回調(diào)輸出。
channel client客戶(hù)端能正常連接,也能正常發(fā)送事件消息,但是服務(wù)端始終無(wú)法接收消息和通知訂閱用戶(hù)。
channel server狀態(tài)截圖
補(bǔ)充:
在本地測(cè)試都o(jì)k,在線(xiàn)上阿里云ECS就不行了(阿里云firewall沒(méi)有啟用,iptables沒(méi)有安裝,telnet 可以連接ip 端口),
線(xiàn)上服務(wù)器上pcntl、posix、sockets、event擴(kuò)展都安裝ok,pcntl、posix相關(guān)函數(shù)都啟用
php 5.6.33
workerman 4.026