Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3236898
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:40:30+00:00 2026-05-17T17:40:30+00:00

I am creating a silverlight card game which talks to a WCF service using

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:40:31+00:00Added an answer on May 17, 2026 at 5:40 pm

    The InstanceContextMode (as you probably know) is PerSession, PerCall or Single. None of these support the scenario of maintaining a single instance for a particular implementation of the service. Instead these refer to the nature of the connection between the service and the client. For instance PerSession will create new instance of you service implementation for each new client session.

    The ideal solution I would think is to store saved games in a database keyed by game type, but keep ongoing games in memory within a singleon instance.

    However, if you do need to implement something along the lines of instance sharing among clients then there is some documention on this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.