Android immediate disconnect after connect

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

Post Reply
harelba
Posts: 4
Joined: 18 May 2011, 00:33

Android immediate disconnect after connect

Post by harelba »

Hi, i've similar things in a couple of other threads, but they diverted to other subjects.

I'm connecting from an android skeleton app to the sfs2x server and the result is that the server is connecting and immediately disconnecting the session. Below is the log after setting server logging level to trace.

The version is RC2a and the java client is b3. Can you please provide some assistance?

Thanks a lot (btw, great software! I really love it!)
RL

Code: Select all

01:42:12,011 INFO  [main] v2.SmartFoxServer     - SmartFoxServer 2X (2.0.0-RC2a) READY!
01:42:37,934 TRACE [SocketAcceptor-1] core.SocketAcceptor     - Accepted client connection on: 0:0:0:0:0:0:0:0:9933
01:42:37,937 INFO  [SocketReader] core.SocketAcceptor     - Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 192.168.1.106:42106 } on Server port: 9933 <---> 42106
01:42:38,097 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 1, Type: DEFAULT, Logged: No, IP: 192.168.1.106:42106 }
01:42:38,097 DEBUG [SocketReader] v2.SmartFoxServer     - []
The client code is as follows (sadly i couldn't find a way to load sfs-config.xml using loadConfig so i'm using a manual connect for now):

Code: Select all

       sfs = new SmartFox();
        sfs.addEventListener(SFSEvent.CONFIG_LOAD_SUCCESS, this);
        sfs.addEventListener(SFSEvent.CONNECTION, this);
        sfs.addEventListener(SFSEvent.CONFIG_LOAD_FAILURE, this);
        sfs.addEventListener(SFSEvent.CONNECTION_LOST, this);
        sfs.addEventListener(SFSEvent.EXTENSION_RESPONSE, this);
        sfs.addEventListener(SFSEvent.DEBUG_MESSAGE, this);
        sfs.addEventListener(SFSEvent.LOGIN, this);
        sfs.addEventListener(SFSEvent.LOGIN_ERROR, this);
        sfs.addEventListener(SFSEvent.CONNECTION_RETRY, this);
        sfs.addEventListener(SFSEvent.HANDSHAKE, this);
        sfs.setDebug(true);
        sfs.setUseBlueBox(true);
        sfs.connect("192.168.1.106",9933);
yellowxz
Posts: 3
Joined: 07 Aug 2011, 12:16

Post by yellowxz »

I think maybe there is a problem in ip config. Try to use ipv4 only or ipv6 only. See what lapo posted in http://forums.smartfoxserver.com/viewtopic.php?t=10370
mente
Posts: 73
Joined: 14 Apr 2011, 14:27

Post by mente »

Try to sync server and client versions. I had problems with RC3 client and RC2a server. Probably it's not your case, but you should always use same client/server versions.
Post Reply