Home > Backend Development > PHP Tutorial > PHP套接字链接有关问题

PHP套接字链接有关问题

WBOY
Release: 2016-06-13 10:23:42
Original
1036 people have browsed it

PHP套接字链接问题
PHP代码如下:

C# code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $connection = socket_connect($socket, $IP, 2012);  
Copy after login

明明我本机上的2012端口已经处于监听状态,为什么从别的机子上的PHP不能连接到我机子上的2012端口,从本机的PHP就能连接到?该怎样设置?

------解决方案--------------------
客户端的网络环境很复杂,你的IP是不可能被服务器访问的,除非在那个路由器那里,做一个转发
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template