views:

17

answers:

1

I am scaling up a socket server written in JAVA using xSockets to support rooms (multiple serving sessions?), and am wondering how to execute multiple server loops at once. I have a room class, that when full needs to execute the application severing code.

That is myRoomInstance.run() needs to run to synchronize the clients for the entire duration of their connection. Every time a new room is setup, it should execute newRoomInstance.run(). Meanwhile I have a listener making new rooms, and off course the old rooms are still synchronizing their clients.

My problem is how can multiple instances run at once dividing up resources? What classes do I need to do this? Any references on said classes?

Is this a good OOP layout? Is there a better way to serve rooms?

A: 

Sounds like each room needs its own thread, but there's so little useful information here it's impossible to comment further.

EJP