I am new to android and doing a demo app for gcm push notification.
I have developed all this code and GCM push notification is coming on devices in my environment, but
Try to ping google.com from your server. If it is not success try to investigate your server configuration.
E.g. Check you /etc/resolv.conf and see if you have:
nameserver 8.8.8.8
nameserver 8.8.4.4
At last I found the reason.My company firewall was blocking all messages from GCM. So I just removed firewall and able to receive messages from GCM . Go through this link to know more about firewall issues
Hope it will help somebody in future.