none
"Deadlock" in WCF Router RRS feed

  • Question

  • Hello-

      I am working on a hosted (IIS web server) WCF service that is acting as a router between remote client locations and client machines. The basic idea is that a remote client will launch, connect to the router, then register for events and up stream/downstream call backs to the client machines. The basics of this are working fine, however I run into a dead lock - actually a timeout - if the client is trying to make a down-stream request through the router at the same time that the device is trying to push and up stream notification through the router.

     I am going to look into using the .NET Routing binding type, but that doesn't seem to do what I want. 

    What is the proper, or recommended way to solve the problem of having a singleton WCF service that needs to serve multiple clients with two-way communication?

    Thanks,

    -Tyzack

    Monday, July 21, 2014 7:17 PM

Answers

  • I don't think what you are trying to do is going to work. What you may need to do is use legacy socket programming and possibly do a solution where a server machine has a service to handle client requests,  and it can act as a client to a client-machine that is hosting a service so the server machine can make contact with client machines.  
    Wednesday, July 23, 2014 12:00 AM

All replies

  • The only way of handling this is to persist the callback list in some kind of share-able resource, such as a database, a cache, or even a file on a shared drive. This can be accessed by each instance of your service on startup, so all callbacks are loaded back in in the event of failure.

    Sorry this is probably not what you want to here.

    Tuesday, July 22, 2014 6:49 AM
  • Interesting. I already am persisting the list.

    My WCF server is currently configured as an always running singleton. Are you suggesting that if I persist the device/client list I can then make the service per-call? Would that get rid of the dead lock problem?

    [Update]

    Making the service per-call didn't work. Clearly.

    Here is what I'm trying to do:

    Create a WCF service that acts a a router for two way communication between remote diagnostic clients and custom manufactured equipment.

    It needs to be able to receive "push" notifications from the devices and forward them to clients.

    Need to be able to handle "pull requests" from clients and get the data off the systems.

    • Edited by tyzack Tuesday, July 22, 2014 6:43 PM
    Tuesday, July 22, 2014 11:14 AM
  • I don't think what you are trying to do is going to work. What you may need to do is use legacy socket programming and possibly do a solution where a server machine has a service to handle client requests,  and it can act as a client to a client-machine that is hosting a service so the server machine can make contact with client machines.  
    Wednesday, July 23, 2014 12:00 AM