Page 1 of 1

Socket Programming

Posted: Sat Dec 12, 2009 6:30 pm
by JackD
The following code fails to connect with the error message: 111 - Connection refused

$SockErr = 0;
$SockErrMsg = "";

if (!$Socket_Fd = fsockopen('96.38.238.50', '8000', &$SockErr, &$SockErrMsg))
{ echo $SockErr . ' - ' . $SockErrMsg;
exit;
}

yet, if I paste 96.38.238.50:8000 into the browser it connects just fine.

Apparently, I am doing something basically wrong.

Can anyone help?

Thanks

Re: Socket Programming

Posted: Sat Dec 12, 2009 6:48 pm
by requinix
Works fine for me. Perhaps there's a firewall blocking the connection?

Re: Socket Programming

Posted: Sat Dec 12, 2009 9:17 pm
by JackD
It was our hosting service. They do not allow any ports except 80 and the corresponding https port.