php来做数据包转发,求思路、代码都可以哇~该怎么处理

WBOY
Release: 2016-06-13 10:03:08
Original
1620 people have browsed it

php来做数据包转发,求思路、代码都可以哇~~!!!
现在有一个需求 需要用php来做一个数据包的转发功能, 具体需求:
监听本地某个端口(A、B均是通过这个端口进行通信的), 将A要发送的数据包转给B,将B要发送的数据包转给A。
就是这样,就是要用php来实现一个类似中转站的程序,请问大家有没有什么比较好的思路或者代码~ 谢谢啦!!

------解决方案--------------------
可以去google一下php socket server,不过这个用PHP实现有点蛋疼,换Java或者C/C++吧
------解决方案--------------------
gearman 可以实现你需要的功能..还有队列.消息等机制.....

socket都已经过时了.而且不稳定..最好采用curl
------解决方案--------------------
做二个接收文件,
从a post---b $_post 来接收
从B post---A $_post 来接收

------解决方案--------------------
学习了。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!