Hi Jonny,
I've seen your new thread and posted my reply there. Here is my reply
content for your convenience:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Hi Jonny,
Thanks for your followup.
Also sorry for the late reponse as I was dealing with some other issues
recently. Regarding on the detecting client-side disconnecting problem,
I've also performed some further research. It seems for normal one-way
binding(comparing to thte duplex binding), the client-side disconnect
detection is not real-time. Here are some web articles discussing on this
issue:
#WCF Notification on Disconnect
http://www.rcs-solutions.com/blog/2008/07/06/WCFNotificationOnDisconnect.asp
x
#Taking Action on Client Close
http://blogs.msdn.com/drnick/archive/2008/01/07/taking-action-on-client-clos
e.aspx
#Provide Way to Detect Client Abort/Disconnect in WCF
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/7fb25e30-fc74-4a52-
9dfd-232c67c84f7a
I've tried registering some eventhandler on the OperationContext's Channel,
but those event won't be raised until the service method return data to
client-side. e.g,
========================
public string GetData(string user)
{
Console.WriteLine("GetData Begin:{0}", DateTime.Now);
OperationContext oc = OperationContext.Current;
oc.Channel.Closed += new EventHandler(Channel_Closed);
oc.Channel.Closing += new EventHandler(Channel_Closing);
oc.Channel.Faulted += new EventHandler(Channel_Faulted);
for (int i = 0; i < 10; ++i)
{
Console.WriteLine("Loop:{0}, State:{1}",i,
oc.Channel.State);
Thread.Sleep(1000 * 3);
}
Console.WriteLine("GetData End:{0}", DateTime.Now);
return "result of " + user;
}
===============================
If duplex binding is possible for your scenario, you may have a try on the
solution mentioned in above articles.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
--------------------