0

Say we have the following class in client app:

public class TestClass
{
    public void CallWCFService()
    {
        WCFClient svcClient = new WCFClient("endpointName");

        var x = svcClient.GetFoo();

        // no Close() or Abort() method here...    
    }
}

What happens if I create an instance of TestClass from a different class, and call it's CallWCFService() method?

Does garbage collection take care of the svcClient?

Does this mean that the service host have an unavailable channel until svcClient eventually dies somehow?

Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
IWriteApps
  • 973
  • 1
  • 13
  • 30

1 Answers1

0

Yes until the session (if you have one) reaches the timeout you will have a pending connection, depending of how your service is configured that usually drives to great problems

MaRuf
  • 1,834
  • 2
  • 19
  • 22
  • Is that a yes to garbage collection closing the channel or a yes to the service having an unavailable channel until a client channel dies? – IWriteApps Aug 16 '12 at 16:41
  • Is yes for both of them, if you have a session the garbage collector will take care of the proxy but just when the session times out, so you have one connection alive and unavailable on the service – MaRuf Aug 16 '12 at 20:01