V
Vai2000
Hi All, I have written a win service MSMQListener. On the OnStart method I
call a queue worker class which basically goes and invokes the delegate with
the following signature
OnStart()
{
QWorker q=new QWorker();
q.Run();
}
class QWorker{
void Run()
{
this.msmq=new MessageQueue(path);
this.msmq.ReceiveCompleted += new
System.Messaging.ReceiveCompletedEventHandler(this.msmq_ReceiveCompleted);
}
private void msmq_ReceiveCompleted(object sender, ReceiveCompletedEventArgs
e)
{
// do something
}
} // end of QWorker
I wanted to know what should I do on the OnStop method of the Service
Controller, because if I call GC.Collect on the stop method my service
crashes.
BTW If Don't do anything on the OnStop method everything is fine!!!!!
OnStop()
{
GC.Collect(); // Crashes
}
TIA
call a queue worker class which basically goes and invokes the delegate with
the following signature
OnStart()
{
QWorker q=new QWorker();
q.Run();
}
class QWorker{
void Run()
{
this.msmq=new MessageQueue(path);
this.msmq.ReceiveCompleted += new
System.Messaging.ReceiveCompletedEventHandler(this.msmq_ReceiveCompleted);
}
private void msmq_ReceiveCompleted(object sender, ReceiveCompletedEventArgs
e)
{
// do something
}
} // end of QWorker
I wanted to know what should I do on the OnStop method of the Service
Controller, because if I call GC.Collect on the stop method my service
crashes.
BTW If Don't do anything on the OnStop method everything is fine!!!!!
OnStop()
{
GC.Collect(); // Crashes
}
TIA