Discussion Forums  >  Self Hosted Control Panels

Replies: 10    Views: 1058

epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
03/14/13 10:08 AM (12 years ago)

Check Push Notification Port

Example script will allow you to check that port 2195 is open. Upload this to your self hosted server and run. remove // to check production <?php chkServer('gateway.sandbox.push.apple.com',2195); //chkServer('gateway.push.apple.com',2195); function chkServer($host, $port) { $hostip = @gethostbyname($host); if ($hostip == $host) { echo "Server is down or does not exist"; } else { if (!$x = @fsockopen($hostip, $port, $errno, $errstr, 5)) { echo "Port $port is closed."; } else { echo "Port $port is open."; if ($x) { @fclose($x); } } } } ?>
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
03/14/13 10:38 AM (12 years ago)
ahhh nifty, thanks!
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
03/14/13 10:40 AM (12 years ago)
welcome.. hope it helps others.
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
03/14/13 12:08 PM (12 years ago)
Good test, works like a champ, thanks.
 
SheriDee
Code is Art
Profile
Posts: 1094
Reg: Sep 23, 2011
location unknow...
22,840
like
03/14/13 01:22 PM (12 years ago)
Excellent! Thanks so much!
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
03/14/13 01:58 PM (12 years ago)
what if the port is open but push still doesn't work ?
 
Korkut Ata
Aspiring developer
Profile
Posts: 108
Reg: Aug 09, 2011
Luxembourg
11,580
like
03/14/13 01:59 PM (12 years ago)
Great share!... Thanks so much..
 
epicweb
Aspiring developer
Profile
Posts: 159
Reg: Aug 30, 2012
Glen Carbon
4,990
like
03/14/13 02:03 PM (12 years ago)
@Aussiedra... could be a number of different issues but that test will address the port question. Maybe David can add this script in the self hosted download to at least help run the port check.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
03/14/13 04:08 PM (12 years ago)
I have the same issue as Aussidra, I know I have setup my certificates right, devices are shown in BT control panel, but no push. Ports are open. I'm self hosting. Aussiedra, who do you have your host with, if you are self hosting?
 
aussiedra
Code is Art
Profile
Posts: 431
Reg: Dec 25, 2010
Brisbane, Austr...
8,260
like
03/14/13 04:58 PM (12 years ago)
With 1and1
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/14/13 10:43 PM (12 years ago)
Sweet! Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.