I'm working on a game that will have a fairly heavy load. The client wants the Lobby and Game Servers separated so that we can scale them as needed (as well as a few other reasonable points). The way we're accomplishing this is that we're having the Lobby Server act as a match maker for the users at which point it sends them back a unique room name and the IP address of the game server they will be joining. At this point each player disconnects from the Lobby Server and connects to the new server.
This all seems to work fairly well.
A problem arises when I attempt to test it under a reasonably heavy load. I've written a small flash client that creates hundreds of simultaneous connections and then keeps feeding it a set of new connections every 5 seconds. The game server plays a mock game with each of the players and the players disconnect when they are done with the game. After running for a minute or so with no issues I recieve an error in the flash client stating that an operation is being attempted on an invalid socket.
Code: Select all
Error: Error #2002: Operation attempted on invalid socket.
at flash.net::Socket/internalClose()
at flash.net::Socket/close()
at com.smartfoxserver.v2.bitswarm::BitSwarmClient/disconnect()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/bitswarm/BitSwarmClient.as:273]
at Function/<anonymous>()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/SmartFox.as:1104]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
If I dismiss this and let this continue to run ultimately one of the java processes will consume all off the available CPU.
Whether these issues are related or not they both seem to pose a problem.
Any ideas as to what's going wrong?
Thanks,
Daniel