rbrown Posted January 23, 2008 Share Posted January 23, 2008 If I use this: $fp=fsockopen($ip_address_lookup, $port, $errno, $errstr, 4); And I intentionally enter an invalid domain name so I don't get an ip address I get: 0= $errno Success=$errstr And if I use a valid domain name I get: 0= $errno =$errstr Any idea why? Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/87435-solved-fsockopen-returns-success-when-fails/ Share on other sites More sharing options...
fanfavorite Posted January 23, 2008 Share Posted January 23, 2008 "UDP sockets will sometimes appear to have opened without an error, even if the remote host is unreachable. The error will only become apparent when you read or write data to/from the socket. The reason for this is because UDP is a "connectionless" protocol, which means that the operating system does not try to establish a link for the socket until it actually needs to send or receive data." Quote Link to comment https://forums.phpfreaks.com/topic/87435-solved-fsockopen-returns-success-when-fails/#findComment-447228 Share on other sites More sharing options...
rbrown Posted January 23, 2008 Author Share Posted January 23, 2008 Thanks.. I'll try to send / get something from the server and then use those error codes. Quote Link to comment https://forums.phpfreaks.com/topic/87435-solved-fsockopen-returns-success-when-fails/#findComment-447268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.