LitePeer for Android

edited January 2013 in Native

I am new to Photon development and need help with creating client code. I have followed the hello world demo in Demos. I have reached a point where i can successfully make a connect call. The onStatusChanged status code returns 1023 i.e the PhotonPeer encountered an exception while opening the incoming connection to the server. The server could be down / not running.

I have the photon default running on my system whose ip is The call that i make is mLitePeer->connect("");
I can ping my sysytem successfully from my device which is a Galaxy Ace. But when i run the code on it, i get the above response.

Please help me to get the code running. would there be anything that i am missing out on the client or the server side??

Thank you!


  • Hi rav_prkh

    My first guess in this case would be, that you have a firewall issue.

    Please assure, that you have allowed udp-traffic for port 5055 in the firewall settings of the computer, on which you are running the server, and also on an eventual router in between.

    You could also check with the test client from the server SDK and with the C++ Windows Client, if you can reach your server with a client, thats running on the same machine.
  • Hi Kaiserludi,

    Thank you for a quick reply!

    As you mentioned, I did adjust my firewall settings to allow UDP traffic on port 5055. I restarted the server after doing so and then rerun my code. It still gives the same error code i.e 1023.

    Also I wanted to ask if it could be an issue at OS level, cause one of my friends tried it on a XP based system and it worked for him. Mine is a Windows 7, 64bit system.
  • I assume, that your device is in the same local wifi network like your server. Is that correct? If you are trying to connect through 3G,then you have to setup your server first to be reachable from outside of its local network.
    Have yo checked, if you can connect from a client, that is connecting from withing the same computer like the one, on which your server is running? Otherwise you are shooting in the dark.
  • You are right! The device works on the same network, but i tried a different network as well. Thought of trying it out on the Cloud, but the same problem occurs there too. I send the connect to get a callback on connectionErrorReturn() with errorCode 1023 an debugReturn().

    Have tried almost what I understood from the examples and documentation.

    A humble request, if you can guide me to a perfectly working cocos2dx example or help me with one.

    Thanks a ton!!
  • I tried getting the string out of the Jstring received in debugReturn(). Got the following:

    PeerBase.cpp connect() line: 177 - failed: PhotonConnect_createConnection() failed.

    Did not find PeerBase.cpp in my Cloud SDK. Any guesses??

  • On the cloud currently only the LoadBalancing demo will work (thats why its the only demo, thats inside the cloud SDK). The other 3 demos are targetting the Lite application, which means, that the default instance of the server has to be running, while the loadBalancing demo needs the loadBalancing instance to be running.
    However even helloWorld demo is still able to connect to the cloud, it just won't be able to do anything further, so a statusCode 1023 definetly means that there is something else going wrong.
    However when you get 1023 from the cloud, then it's definitely not a server-, but a client issue but there should not be the need for any special client side setting. It should just work. Does it work for you in the Android emulator? Maybe its an issue with your 3G network provider. Does it work for you on wifi?

    About cocos2d-x:
    The realtime demo in our AndroidNDK Client SDK uses cocos2d-x (but uses Lite, so not compatible to the cloud).
    Here you can also fine a tutorial about using cocos2d-x and Photon together for an Android and iOS cross-platform game: viewtopic.php?f=18&t=2187 . That tutorial is using the LoadBalancing API, so it's compatible to the Photon Cloud.
Sign In or Register to comment.