Page 1 of 1

fsockopen timeout

Posted: Tue Nov 18, 2014 4:37 pm
by semperfi
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!

Re: fsockopen timeout

Posted: Wed Nov 19, 2014 6:29 pm
by dave

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.



Re: fsockopen timeout

Posted: Sat Nov 22, 2014 8:07 pm
by semperfi
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.