none
WCF connection not getting close on server even after getting response RRS feed

  • Question

  • Hi All,

    I have a wcf service hosted on IIS server.Now i make a call to WCF service using async method from my client application.Once i get repsonse i expect the one connection created to this server which can be seen in performance monitor should be closed.Is there a way in which we can close this connection.

    Regards

    Abhishek Anand

    Wednesday, April 13, 2016 7:33 AM

Answers

  • Did you monitor the TCP connection using some network packet analyzer like Netmon/WireShark? Perfmon isn't always definitive.

    Thanks Arindam

    Wednesday, April 13, 2016 4:49 PM
  • Hello,

    We can close the this connection in code behind as following:

    YourClientProxy client = new YourClientProxy();try {

    // do something ... client.Close(); } catch (CommunicationException e) { ... client.Abort(); } catch (TimeoutException e) { ... client.Abort(); } catch (Exception e) { ... client.Abort(); throw; }


    Besides, as @Arindam Paul Roy said performance monitor isn't always definitive. We can not completely rely on the performance monitor to determine if the connection is closed or not.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 14, 2016 5:56 AM
    Moderator

All replies

  • Did you monitor the TCP connection using some network packet analyzer like Netmon/WireShark? Perfmon isn't always definitive.

    Thanks Arindam

    Wednesday, April 13, 2016 4:49 PM
  • Hello,

    We can close the this connection in code behind as following:

    YourClientProxy client = new YourClientProxy();try {

    // do something ... client.Close(); } catch (CommunicationException e) { ... client.Abort(); } catch (TimeoutException e) { ... client.Abort(); } catch (Exception e) { ... client.Abort(); throw; }


    Besides, as @Arindam Paul Roy said performance monitor isn't always definitive. We can not completely rely on the performance monitor to determine if the connection is closed or not.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 14, 2016 5:56 AM
    Moderator