Php is used for packet forwarding. you can find ideas and code ~ What should I do?

Source: Internet
Author: User
Php is used for packet forwarding. you can find ideas and code ~~!!! Now there is A need to use php for data packet forwarding. Specific Requirements: listen to A local port (both A and B communicate through this port ), forward the data packet to be sent by A to B and the data packet to be sent by B to. In this case, php is used to implement a program similar to a transfer station. do you have any good ideas or code ~ Thank you !! ------ Solution -- use php to forward data packets. you can find ideas and code ~~!!!
There is a need to use php for data packet forwarding. specific requirements:
Listen to A local port (both A and B communicate through this port), forward the data packet sent by A to B, and forward the data packet sent by B to.
In this case, php is used to implement a program similar to a transfer station. do you have any good ideas or code ~ Thank you !!

------ Solution --------------------
You can google the php socket server, but it is a bit painful to use PHP. change Java or C/C ++.
------ Solution --------------------
Gearman can implement the functions you need... there are queues, messages, and other mechanisms .....

The socket is out of date and unstable. it is best to use curl.
------ Solution --------------------
Make two receiving files,
Receive from a post --- B $ _ post
Receive from B post --- A $ _ post

------ Solution --------------------
I learned.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.