I need to resolve a large amount of IP addresses. I'm using gethostbyaddr() for it.

I just recently read about using pcntl_fork() and that if you do fork, you don't have to wait for a timeout.

Since gethostbyaddr will take a long time (30 seconds, I think) to resolve a host before timeout, is pcntl_fork practical for use with a large amount of IP addresses?

有帮助吗?

解决方案

You want a high-performance, asynchronous DNS library for PHP. Fortunately, Net_DNS2 is exactly that.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top