Lost Connection and Reconnection

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

Moderators: Lapo, Bax

User avatar
regulxenao
Posts: 34
Joined: 03 Mar 2011, 20:29

Lost Connection and Reconnection

Postby regulxenao » 23 Jun 2011, 05:59

Hello!

SFS version: 2.0.0-RC2a
Platform: Flash

Often the connection win SFS behaves unclear:
I don't recive any event from SmartFox class (no CONNECTION_LOST). But client stop revice messages from server. Form check it I every 2 minutes of silence send my own "ping" command (created by Extension).
By the way, I try to use your PING_PONG request and it don't wont to work, maby I do something wrong.

However, if I revice answer from server by my ping command - that's mean, that connection alive. But if I don't resive any responce in 5 sec, I deside, that connection lost. I do disconnect(), wait for LOST_CONNECTION event, and then, after 5 secons, execute connect() command.

It script work successfully only at 10% of issues. As a rule, after sendiong connect() command I don't resive any responce from server and after 2 minutes of silence I do reconnection agane and agane, but without result.

What problem is? What I do wrong?
My server configuration I post at previos topic:
http://www.smartfoxserver.com/forums/viewtopic.php?p=47083#47083
User avatar
Lapo
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Jun 2011, 13:59

I am sorry but this super confusing. Let's try to break down the problem into smaller sections.

1) You problems connecting, right? You say you start a connection and it doesn't receive any data back.
Let's start with this.
What client is being used here? Flash? Unity? Others?
Do you get a specific client side error? You should. Which one please?
Do you see errors in the server logs?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
regulxenao
Posts: 34
Joined: 03 Mar 2011, 20:29

Postby regulxenao » 23 Jun 2011, 15:58

I am sorry, Lapo. Really, my explanation really leads to confusion.

First of all, I wrote:
SFS version: 2.0.0-RC2a
Platform: Flash


That's script:

1. The flash-client connects to SmartFox server. No problem with connecting.
2. All work well: flash-client resive and send messages to chat.
3. After a while (this can happen from 5 minutes to 5 hours after work correctly) chat no receive any messages. But SmartFox class at flash client didn't dispatch evet CONNECTION_LOST and client think, than it still connected.
For check it, I'm sending "ping" command to server (It's Extension command). If connection still alive - all right. But if ping didn't return after 5 sec I deside that connection lost silently(without CONNECTION_LOST).
It's first problem - LOST CONNECTION WITHOUT DISPATCH EVENT, but it not the question.

The question is WHY I CAN'T RECONNECT?
4. I execute disconnect(),
5. wait for CONNECTION_LOST event,
6. execute connect()

And nothing happens(no event's after connect() command). I do reconnection again after 2 minutes, and again, but to no avail.
COB
Posts: 68
Joined: 28 Dec 2010, 08:54

Postby COB » 28 Jul 2011, 04:21

I see similar thing. I am sending connect messages in loop every 5 seconds. When connect does not succeed I see SFSEvent.CONNECTION event, byt without success. However when real connection becomes possible I have no event at all.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DavinVicy, DerikFent, JerodSa and 5 guests