JoinZone extension block

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

Moderators: Lapo, Bax

Post Reply
king3200
Posts: 25
Joined: 28 Oct 2010, 01:48

JoinZone extension block

Post by king3200 »

I wrote a endless loop test in USER_JOIN_ZONE extension:

Code: Select all

	@Override
	public void handleServerEvent(ISFSEvent evt) throws SFSException {

                User user = (User) evt.getParameter(SFSEventParam.USER);
		Zone zone = (Zone) evt.getParameter(SFSEventParam.ZONE);
		
		trace(user + " join zone");
		if(UserUtils.isGuest(user)){
			while(true){
				
			}
		}
		trace(user + " join zone over");
}
and then logged on several users, after 4-5 users block in USER_JOIN_ZONE extension, the extension would no longer response.
if I want to do Some very time-consuming operation in USER_JOIN_ZONE extension, It will be the same... ...
How can I do? thanks and forgive my poor English...
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: JoinZone extension block

Post by rjgtav »

Hi,
The extension stops responding because all the ExtensionsController threads are busy, running that infinite loop.
If your application/game starts experiencing issues like this, you can increase the ExtensionsController pool size by small increments at a time, around 2-3, from the ServerConfigurator Module of the AdminTool.
But if the database is the bottleneck, you can also try increasing the DBManager's Maximum # of active connections, from the Zone Configurator Module.
You should also review your code and your queries and try to optimize it the most, in order to get the best performance from the server.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: JoinZone extension block

Post by Lapo »

Besides the fact that an infinite loop will make the server malfunction, what would be the purpose of the test?
If you are looking into slowing down the response then just remove the loop and put a Thread.sleep(millis) instead.
Lapo
--
gotoAndPlay()
...addicted to flash games
king3200
Posts: 25
Joined: 28 Oct 2010, 01:48

Re: JoinZone extension block

Post by king3200 »

rjgtav wrote:Hi,
The extension stops responding because all the ExtensionsController threads are busy, running that infinite loop.
If your application/game starts experiencing issues like this, you can increase the ExtensionsController pool size by small increments at a time, around 2-3, from the ServerConfigurator Module of the AdminTool.
But if the database is the bottleneck, you can also try increasing the DBManager's Maximum # of active connections, from the Zone Configurator Module.
You should also review your code and your queries and try to optimize it the most, in order to get the best performance from the server.
thanks for reply, get it~~ :D
Post Reply