fsockopen timeout

Support forum for the PHP DNS Query API
Post Reply
semperfi
Posts: 2
Joined: Tue Nov 18, 2014 4:31 pm

fsockopen timeout

Post by semperfi » Tue Nov 18, 2014 4:37 pm

Query timeout isn't working for me.

Using v1.02 from github, line 439

Code: Select all

if (!$socket=fsockopen($host,$this->port,$this->timeout))
fsockopen expects args 3 and 4 to be errno,errstr, and arg 5 to be the timeout.

I have modified my version locally and timeout seems to be working now.

Code: Select all

if (!$socket=fsockopen($host,$this->port,$errno,$errstr,$this->timeout))
Great library, such a time saver!

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: fsockopen timeout

Post by dave » Wed Nov 19, 2014 6:29 pm

Hi,

Great thanks for your feedback and for finding/fixing that bug.

It's been logged (BID398) and should be resolved in the latest version (1.03) which has been uploaded to github, basically exactly what you said.

This will get pushed out to the general download at some point in the near future. I've thanked you as 'semperfi' in the comments - let me know if you would like a different name (for all the massive kudos!!) or that's not ok for any reason.

Thanks again and glad you're finding phpdns useful.

Regards,

Dave.

semperfi
Posts: 2
Joined: Tue Nov 18, 2014 4:31 pm

Re: fsockopen timeout

Post by semperfi » Sat Nov 22, 2014 8:07 pm

No worries, no credit was necessary, just trying to help out.

Actually, if php provided a way to timeout on gethostbyname()/gethostbyaddr() without having to shell out, I don't think I would have ever even found your library. Glad I did though.

Post Reply