Connection refused, by my server or remote server ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

Connection refused, by my server or remote server ?

Post 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
greip
Forum Commoner
Posts: 39
Joined: Tue Aug 23, 2011 8:23 am
Location: Oslo, Norway

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

Post 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 '^]'.
aneuryzma
Forum Contributor
Posts: 106
Joined: Sat May 17, 2008 7:03 am

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

Post by aneuryzma »

Unfortunately I only have ftp access to the hosting server.
Post Reply