Home  >  Article  >  Backend Development  >  Ask for advice on how to extend PHP swoole to concurrently scan whether the 65535 ports of IP are open.

Ask for advice on how to extend PHP swoole to concurrently scan whether the 65535 ports of IP are open.

WBOY
WBOYOriginal
2016-08-04 09:19:101658browse

I want to ask for advice on how to use the PHP swoole extension to scan whether the 65535 ports of the IP are open.
I just recently learned about the swoole extension. I have learned about the pthreads extension before, but I have no idea.
Problems that need to be solved:
Whether concurrent scanning of 11,000 IPs survives (your own solution is to use ping or fsockopen, nodejs, but the efficiency is too low or you still want to use a PHP environment)
2. Scan 65535 ports of a single IP and view the ports Whether to turn on.

Responses needed:
1. Can swoole solve the above needs? Please provide some ideas and key points of research

Reply content:

I want to ask for advice on how to use the PHP swoole extension to scan whether the 65535 ports of the IP are open.
I just recently learned about the swoole extension. I have learned about the pthreads extension before, but I have no idea.
Problems that need to be solved:
Whether concurrent scanning of 11,000 IPs survives (your own solution is to use ping or fsockopen, nodejs, but the efficiency is too low or you still want to use a PHP environment)
2. Scan 65535 ports of a single IP and view the ports Whether to turn on.

Responses needed:
1. Can swoole solve the above needs? Please provide some ideas and key points of research

Write an asynchronous swoole_client, create it in a loop and connect to the other party's port.

Statement:
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