Ok, so I'm hosting a SoapReceiver in a custom Windows service. Basically, startup looks like this:
protected override OnStartup()
{
SoapReceivers.Add(new Uri("soap.tcp://localhost/Test", typeof(MyWebService));
}
Now, shutdown should look something like this:
protected override OnStartup()
{
SoapReceivers.Remove(new Uri("soap.tcp://localhost/Test"));
// ... need to wait for all receivers processing messages to finish ...
}
The problem is, before I return from shutdown, I want to make sure all outstanding requests are serviced because I don't want my Windows service terminated until then. Since I don't own the threads that are handling the incoming messages, nor do I ever even see those threads from the Windows service's point of view, what's the recommended approach to do this? Something tells me I'll have to do some custom lower level work to get this to work. :\
TIA,
Drew
Drew Marsh - 01 Nov 2004 18:21 GMT
I wrote:
> Now, shutdown should look something like this:
>
[quoted text clipped - 3 lines]
> // ... need to wait for all receivers processing messages to finish
> ... }
Well, obviously that should be "OnStop"... sorry for the typo.
-Drew