Home > Article > Backend Development > Ask for advice on how to extend PHP swoole to concurrently scan whether the 65535 ports of IP are open.
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
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.