Project

General

Profile

Tigase cannot find a client dropped immediately.

shen wr
Added almost 5 years ago

The client A to connect to the tigase through the WIFI, and then close the WiFi, this time the client B has shown that the A online;

General for several minutes before A dropped; then I changed 2 parameter in watchdog to improve it。

c2s/watchdog_timeout[L]=30000

c2s/watchdog_delay[L]=40000

What are the risks? There are other ways?

thks;


Replies (4)

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

This subject was already discussed in this thread: https://projects.tigase.org/boards/4/topics/2105

In principle:

  • setting shorter times for the watchdog increase performance penalty on the server;

  • you could try adjusting system-level keep alive settings as alternative.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

What are the risks? There are other ways?

If you have a handful of users connected to the server than its not a problem. However, consider a service with 100k users connected. If you set watchdog ping to 30 seconds than the server will have to send over 3k pings per second.

My suggestion is to think how serious and how real in practice is the problem with WiFi turned off. For sure it will happen from time to time if people connect from Caffees and they walk away. In such a case their Wifi would be practically off. However, in such a case the mobile device should switch automatically to mobile network and the app should reconnect. If it reconnects with the same resource, then Tigase knows the old connection is no longer valid.

Added by shen wr almost 5 years ago

thks,i get it;

there are another question,

when client B send message to client A;

finally , called channel.write,

The write() method of a SocketChannel do not throw an exception (in fact the connection of A has been lost),

res = channel.write(tmp);

In this case,is there a way to detecting the connection and let client A offline?

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

There is no 100% reliable way. This is why you need additional mechanism to detect message loss and retry sending message. XEP-0198 extension (supported by Tigase server) is probably the best way to start.

    (1-4/4)