Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not connect to tcp://127.0.0.1:1236 Connection refused #14

Closed
wzfjesun opened this issue Nov 22, 2018 · 2 comments
Closed

Can not connect to tcp://127.0.0.1:1236 Connection refused #14

wzfjesun opened this issue Nov 22, 2018 · 2 comments

Comments

@wzfjesun
Copy link

wzfjesun commented Nov 22, 2018

你好,
Gateway::$registerAddress = '127.0.0.1:1236';
执行Gateway::sendToAll('7777');
报错:

Can not connect to tcp://127.0.0.1:1236 Connection refused
Workerman[start.php] status ----------------------------------------------GLOBAL STATUS---------------------------------------------------- Workerman version:3.5.15 PHP version:7.0.32-0ubuntu0.16.04.1 start time:2018-11-22 23:34:57 run 0 days 0 hours load average: 1.73, 1, 1 event-loop:\Workerman\Events\Select 4 workers 11 processes worker_name exit_status exit_count ChatBusinessWorker 64000 3 ChatGateway 0 0 Register 0 0 WebServer 0 0 ----------------------------------------------PROCESS STATUS--------------------------------------------------- pid memory listening worker_name connections send_fail timers total_request qps status 6806 4M none ChatBusinessWorker 5 0 0 5 0 [idle] 6808 4M none ChatBusinessWorker 5 0 0 5 0 [idle] 6810 2M websocket://0.0.0.0:7272 ChatGateway 5 0 1 7 0 [idle] 6811 2M websocket://0.0.0.0:7272 ChatGateway 5 0 1 7 0 [idle] 6812 2M websocket://0.0.0.0:7272 ChatGateway 7 0 1 21 0 [idle] 6813 2M websocket://0.0.0.0:7272 ChatGateway 6 0 1 14 0 [idle] 6814 2M text://0.0.0.0:1236 Register 8 0 0 11 0 [idle] 6815 2M http://0.0.0.0:55151 WebServer 0 0 0 0 0 [idle] 6816 2M http://0.0.0.0:55151 WebServer 0 0 0 0 0 [idle] 6817 4M none ChatBusinessWorker 5 0 0 6 0 [idle] 6864 4M none ChatBusinessWorker 5 0 0 11 0 [idle]

为什么注册的时候必须用text协议,但是连接却代码里写死了用tcp协议呢?
screenshot from 2018-11-22 23-49-44

@walkor
Copy link
Owner

walkor commented Nov 23, 2018

http://doc2.workerman.net/push-in-other-project.html
看下手册注意事项。

text协议是基于tcp传输的,先要建立tcp连接,然后传输的时候用text协议规定的格式传输。

@wzfjesun
Copy link
Author

我用的docker配的环境,用局域网的方式配registerAddress的ip就可以用了.感谢^_^ @walkor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants