views:

86

answers:

2

I am using the nettcpbinding binding (with reliably messaging at present).

When the server does a serviceHost.Close(), the TCP connection should be cleanly closed and therefore the client side should be told. How do I hook this event with WCF? (Note this is not the same as the TCP connection being closed by a network problem, when reliably messaging may be able to recreate the connection)

If the server calls serviceHost.Abort() , then the client will never be able to send it another message, so I would expect some event to be raised after all the retry timeouts.

(The IChannel.Faulted and IChannel.Closing events do not get fired on the client side)

A: 

Not exactly what you are looking for, but an option wpuld be to configure your service as a duplex service and send a termination notification to clients before closing the service host.

Konamiman
Given that raw "socket" programming tells me when the server side of the TCP connection has been closed, I was hoping for the same from WCF.
Ian Ringrose
+1  A: 

It seems that WCF does not expose a lot of what TCP can do, as it thinks that HTTP is the centre of the world.

Ian Ringrose