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. General Programming
  3. WPF
  4. Silverlight + WCF Communication

Silverlight + WCF Communication

Scheduled Pinned Locked Moved WPF
csharpquestionwpfwcf
4 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.
  • J Offline
    J Offline
    JS 2008
    wrote on last edited by
    #1

    I have a silverlight application which uses wcf service hosted in a wpf application, but when I try to connect more then one client the second client always waits until the first client completes the call.How can I make WCF to accept calls from multiple clients at the same time?

    M 1 Reply Last reply
    0
    • J JS 2008

      I have a silverlight application which uses wcf service hosted in a wpf application, but when I try to connect more then one client the second client always waits until the first client completes the call.How can I make WCF to accept calls from multiple clients at the same time?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I would start by setting the service ConcurrencyMode to Multiple

      \[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple\]
      public class MyService : IMyService
      {
          ...
      

      If you have operations that take time and/or block (like pretty much any device I/O operation does), which apparently you do, you should implement the service operation(s) asynchronously: Synchronous and Asynchronous Operations[^] Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      J 1 Reply Last reply
      0
      • M Mark Salsbery

        I would start by setting the service ConcurrencyMode to Multiple

        \[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple\]
        public class MyService : IMyService
        {
            ...
        

        If you have operations that take time and/or block (like pretty much any device I/O operation does), which apparently you do, you should implement the service operation(s) asynchronously: Synchronous and Asynchronous Operations[^] Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        J Offline
        J Offline
        JS 2008
        wrote on last edited by
        #3

        Thanks for the answer,But I already used [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple],but the problem still exists,Also implemented the service as asynchronously,Could you suggest any other solutions?

        M 1 Reply Last reply
        0
        • J JS 2008

          Thanks for the answer,But I already used [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple],but the problem still exists,Also implemented the service as asynchronously,Could you suggest any other solutions?

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I have no idea what's wrong. It could be in host configuration, service configuration, or the service implementation. I can't reproduce this, even without the [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]. Even a synchronously implemented operation like

              public string EchoStringSynchronous(string msg)
              {
                  Thread.Sleep(10000);
          
                  return msg;
              }
          

          can be executed by multiple clients without a client having to wait for another client's operation to complete.

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          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