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, 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." 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. 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
Archived
This topic is now archived and is closed to further replies.