Page 2 of 2
Posted: 24 Aug 2010, 05:25
by Lapo
Guarav if your code has no errors we would expect this to work flawlessly at least in your dev environment.
Can you please confirm that even in your dev machine this isn't work at all? Never?
If you check any other examples we provide that use a server extension they all work out of the box. There must be something going in your code.
Posted: 24 Aug 2010, 08:07
by Alex
Hi
I have a similar problem - when the user unplug his network cable - the event is not fired right away. The event will be fired eventually - usually from 30 sec to 5 min in some cases. I've tried the different settings in the config files - userIdletime etc. but they had no effect.
The solution I used in sfs 1.6 is to constantly ping the server. Every user ping the server at 5 sec interval - then you save each user last ping time in hashMap. Also you should start a new thread that every 3 second loop all users in the hashMap and check if there are more than 5 secs from the last ping. If there are more than 5 sec - you forcibly disconnect the user.
I'm searching for a more elegant solution though.
Posted: 24 Aug 2010, 08:14
by Alex
Lapo wrote:Guarav if your code has no errors we would expect this to work flawlessly at least in your dev environment.
Can you please confirm that even in your dev machine this isn't work at all? Never?
If you check any other examples we provide that use a server extension they all work out of the box. There must be something going in your code.
Hi
You can not reproduce this problem on a localhost machine. The client ant the server should be on a different computers.
Posted: 24 Aug 2010, 09:11
by Lapo
Alex
I have a similar problem - when the user unplug his network cable - the event is not fired right away.
It will never be and there is a good reason for this.
http://forums.smartfoxserver.com/viewto ... 7716#17716
Hi
You can not reproduce this problem on a localhost machine. The client ant the server should be on a different computers.
By test environment I mean a
local network (LAN), not the localhost.
Posted: 24 Aug 2010, 14:20
by Gaurav
Hello Lapo
I am encountering this issue many time. I have already done the way alex is doing. But for this I have to start a thread which may consume server JVM memory. I just want a way that if any user unplug or his network connection breaks the server will be notified about by any of the internalEvent being fired. Is there any way to do that??
Posted: 24 Aug 2010, 18:09
by Lapo
Starting a new thread is not that heavy
I just want a way that if any user unplug or his network connection breaks the server will be notified about by any of the internalEvent being fired. Is there any way to do that??
Unplugging the network cable is not the same thing as a sudden connection close. Any of these scenarios is different and requires a bit more understanding of how the network works to see why there can be cases in which the event doesn't fire immediately.
The server will be notified eventually but this really depends on the OS implementation (TCP stack) and it's non-deterministic. In other words it might take longer than you expect.
Posted: 24 Aug 2010, 19:22
by Gaurav
Thanks Lapo.
