Fix file handle comparison
'==' can not compare file handles. We can use fileno() function to compare numerically file numbers. Code without this returns "connection successful" when it timeouts and $fd is "undefined".
Please register or sign in to comment