Page 1 of 1

Connection refused, by my server or remote server ?

Posted: Fri Sep 16, 2011 3:20 am
by aneuryzma
I'm trying to connect to a remote server with:

Code: Select all

$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
and I get the following error:

Code: Select all

unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection refused) in ...handleRequest.php on line 437 - Failed to connect 111
How do I know if my server is refusing the connection, or the remote server is refusing it ?
I've already contacted my server technical assistance and they told me the port 2195 is open.

thanks

Re: Connection refused, by my server or remote server ?

Posted: Fri Sep 16, 2011 9:11 am
by greip
If your client is on a Linux-box you can verify that a basic TCP-connection can be set up by telneting to the remote server and port. You can do that test like this:
telnet gateway.sandbox.push.apple.com 2195
If you get a message somewhat like the one below then the basic TCP connection opened fine between your box and the server:
Connected to gateway.sandbox.push.apple.com.
Escape character is '^]'.

Re: Connection refused, by my server or remote server ?

Posted: Fri Sep 16, 2011 9:31 am
by aneuryzma
Unfortunately I only have ftp access to the hosting server.