您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
GatewayWorker-Linux系统快速开始(从一个精简的聊天demo开始)
发布时间:2022-02-07 18:10:08编辑:雪饮阅读()
下載demo源代碼
https://www.workerman.net/download/GatewayWorker.zip
然後解壓源代碼
進入start.php目錄中然後執行如:
[root@localhost GatewayWorker]# /usr/local/php734/bin/php -c /usr/local/php734/lib/php.ini start.php start
Workerman[start.php] start in DEBUG mode
--------------------------------------------- WORKERMAN ----------------------------------------------
Workerman version:4.0.26 PHP version:7.3.4
---------------------------------------------- WORKERS -----------------------------------------------
proto user worker listen processes status
tcp root YourAppBusinessWorker none 4 [OK]
tcp root YourAppGateway tcp://0.0.0.0:8282 4 [OK]
tcp root Register text://0.0.0.0:1238 1 [OK]
------------------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
此時該demo的服務就啓動了,然後可以使用telnet(多個會話)就可以測試聊天了
[root@localhost ~]# telnet 127.0.0.1 8282
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Hello 7f0000010b5500000001
7f0000010b5500000001 login
adas
7f0000010b5500000001 said adas
7f0000010b5500000002 login
7f0000010b5500000002 said kk
aa
7f0000010b5500000001 said aa
关键字词:GatewayWorker,Linux,demo,快速开始