Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. WCF / Single instance / multple concurrency question

WCF / Single instance / multple concurrency question

Scheduled Pinned Locked Moved ASP.NET
wcfquestioncsharpsysadminworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luca Dominici
    wrote on last edited by
    #1

    Hi, I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF. I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image. I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency. Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary? Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work? Thank you! NOTE: using framework 3.5

    E 1 Reply Last reply
    0
    • L Luca Dominici

      Hi, I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF. I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image. I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency. Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary? Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work? Thank you! NOTE: using framework 3.5

      E Offline
      E Offline
      Expert Coming
      wrote on last edited by
      #2

      It is a little unclear as to what the setup is. Are there 9 servers and 9 clients (each running their own instance of WCF)? Or is there only 1 WCF service and 9 different clients accessing that same instance of the WCF service? If you are just having the WCF service build an image and do no server side logic, I would remove the WCF service all together. If there is server side logic, then 1 instance of the WCF service is usually ideal since you only need to update the application in 1 place and the clients all get the functionality (unless the clients require an update as well).

      The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

      L 1 Reply Last reply
      0
      • E Expert Coming

        It is a little unclear as to what the setup is. Are there 9 servers and 9 clients (each running their own instance of WCF)? Or is there only 1 WCF service and 9 different clients accessing that same instance of the WCF service? If you are just having the WCF service build an image and do no server side logic, I would remove the WCF service all together. If there is server side logic, then 1 instance of the WCF service is usually ideal since you only need to update the application in 1 place and the clients all get the functionality (unless the clients require an update as well).

        The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

        L Offline
        L Offline
        Luca Dominici
        wrote on last edited by
        #3

        Thank you for your reply. My configuration is your second one: 1 WCF service for 9 Clients. There is not much server logic in the WCF, but since is a generic Barcode generator placed in a context where a lot of applications could use it, I think that is a good choice to have it in WCF instead of inside the main project. I will do some benchmatks to understand better if it is an issue or not. However, my question regards how to use (and consume) wcf: I have to declare simply:

        public static BarcodeServiceClient BarcodeServiceClient
        {
        get
        {
        if (_barcodeServiceClient == null)
        {
        _barcodeServiceClient = new BarcodeServiceClient();
        }
        return _barcodeServiceClient;
        }
        }

        OR I have to manage channels?

        E 1 Reply Last reply
        0
        • L Luca Dominici

          Thank you for your reply. My configuration is your second one: 1 WCF service for 9 Clients. There is not much server logic in the WCF, but since is a generic Barcode generator placed in a context where a lot of applications could use it, I think that is a good choice to have it in WCF instead of inside the main project. I will do some benchmatks to understand better if it is an issue or not. However, my question regards how to use (and consume) wcf: I have to declare simply:

          public static BarcodeServiceClient BarcodeServiceClient
          {
          get
          {
          if (_barcodeServiceClient == null)
          {
          _barcodeServiceClient = new BarcodeServiceClient();
          }
          return _barcodeServiceClient;
          }
          }

          OR I have to manage channels?

          E Offline
          E Offline
          Expert Coming
          wrote on last edited by
          #4

          You shouldn't have to manage channels. You only need to if you are trying to use features of channels. Look up some basic WCF articles here on CodeProject. You are basically just trying to execute a remote method. That is very straight forward with WCF.

          The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

          L 1 Reply Last reply
          0
          • E Expert Coming

            You shouldn't have to manage channels. You only need to if you are trying to use features of channels. Look up some basic WCF articles here on CodeProject. You are basically just trying to execute a remote method. That is very straight forward with WCF.

            The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

            L Offline
            L Offline
            Luca Dominici
            wrote on last edited by
            #5

            Thank you!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups