There are hundreds of IP addresses, that is, they want to discover that an IP address is disconnected in time. Then return the message. Xiao Cai, I just read some code on the Internet. I can use ping, socket, and curl to write the code. But do I think efficiency is not quite appropriate? Ask experienced friends for support. There are hundreds of IP addresses, that is, they want to discover that an IP address is disconnected in time.
Then return the message.
Xiao Cai, I just read a few codes on the Internet, which are written using ping, socket, and curl.
But do you think efficiency is not quite appropriate?
Ask experienced friends for support.
Reply content:
There are hundreds of IP addresses, that is, they want to discover that an IP address is disconnected in time.
Then return the message.
Xiao Cai, I just read a few codes on the Internet, which are written using ping, socket, and curl.
But do you think efficiency is not quite appropriate?
Ask experienced friends for support.
Use the system function in php to call the fping tool in linux, so that you can ping the tool in batches. (Fping can send a large number of ping requests in parallel in rotation mode)
Should you write such simple code?
Use tools instead of making wheels on your own
You should try the asynchronous library, so the time spent will be the longest delay in ping, rather than all the accumulation of ping time. PHP has swoole, which is located in timeout.