Can't login after some time

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

pgbrandao
Posts: 8
Joined: 26 Nov 2010, 16:34

Can't login after some time

Postby pgbrandao » 18 Feb 2011, 11:28

Hello!

I'm currently using the Community Edition to develop and am having some problems logging in after a while. This happens either within my application (which has a custom login extension) or, for instance, inside the SmartFox admin. The error message I get in the admin is this:

Code: Select all

"Connected to localhost:9933; now performing login"
"A disconnection occurred due to unknown reason; please reconnect"


Trying to connect again after any length of time does not work. The only fix is to restart the SmartFox server. The server also doesn't give any interesting output; for each attempt, output similar to this is printed. Note that it received the login request.

Code: Select all

10:58:30,998 INFO  [SocketReader] core.SocketAcceptor     - Session created: { Id: 30, Type: DEFAULT, Logged: No, IP: 127.0.0.1:61435 } on Server port: 9933 <---> 61435
10:58:31,005 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController     - {IN}: Handshake
10:58:31,013 INFO  [com.smartfoxserver.v2.controllers.SystemController-1] controllers.SystemController     - {IN}: Login
10:58:57,078 INFO  [Scheduler1-thread-1] sessions.DefaultSessionManager     - Session removed: { Id: 30, Type: DEFAULT, Logged: No, IP: 127.0.0.1:61435 }


Can anyone give me some help?

Regards,
Pedro.
tchen
Posts: 191
Joined: 11 Dec 2010, 14:14

Postby tchen » 18 Feb 2011, 17:14

Sounds like something in your custom login extension is starting to throw exceptions after a while. Maybe you're forgetting to release a database resource or something like that?

Just to be sure, use a try-catch block around your code and log any exceptions it throws instead of relying on the main connection thread to do it.
pgbrandao
Posts: 8
Joined: 26 Nov 2010, 16:34

Postby pgbrandao » 18 Feb 2011, 17:46

Indeed... I had forgotten to execute a connection.close()... :oops:

Looks like it's working now. Thanks so much! =)

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 82 guests