numan82 Posted January 15, 2008 Share Posted January 15, 2008 hi I am using socket_bind() for binding the address returns from socket_create() function, doing error checking with socket_strerror(), and it gives out the exact error, and now I want to release the port as soon as it gives out the error, how to do that? below is the code: $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) or die("Could not create socket\n"); $result = @socket_bind($socket,gethostbyname($_SERVER['HOSTNAME']),12362) or die("Could not bind to socket, Please restart the computer-- ". @socket_strerror(socket_last_error($socket)) ); Thanks! Link to comment https://forums.phpfreaks.com/topic/86091-socket-programming-socket_bind-error-checking/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.