Hi
I am creating a silverlight card game which talks to a WCF service using a duplex binding
Each client communicates with the service when it is their turn by sending their ID and the cards they want to play
And in response, the updated Game state is transmitted to each client
While I've been testing, I have had the instancing set up as follows
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
This means the game state is maintained in memory.
Now if I want to set this up for widespread use, (it's unlikely to be very popular but lets assume that more than 1 game might be played at the same time), what would be the most appropriate WCF Instancing mode?
I am currently thinking that serializing the game state to a document database after each players turn, then retirieving it on future client comms
But I am curious to know if there is a way to maintain the game state in memory, but for multiple games
e.g. if there are 3 games happening at the same time, can the clients for game A all connect to one service instance aned the clients for game B connect to another instance?
Or is the only way to have each client pass a game id and retrieve a serialized game state from a DB or other data store?
EDIT:
I'm specifically interested in Sharable services - see this article http://msdn.microsoft.com/en-us/magazine/cc163590.aspx But that doesn't seem to be availiable in the version of WCF I am using. I only have Single, Persession and PerCall