Hi Folks,
I am developing an application consisting of a webservice and a Win32
service both written in C#.
When the webservice is called it writes a number of records away to a SQL
server database. These records require further processing by the Win32
service as soon as they appear in the database. The database in SQL 2000.
The easiest way for the Win32 service to check if it needs to do anything is
to actively poll the database every few seconds looking for any new records
written away by the webservice but I am not a great fan of any form of
active polling and would rather the Win32 service was notified of the need
to go look in the database for the new records.
The key drivers for any solution are reliability and simplicity and with
that in mind I have identified a number of potential solutions:-
1. Notify the Win32 service by via a named pipe. Downside is that there is
no managed implementation in .NET until v3 of the framework.
2. Notify the Win32 service via a remoted object
3. Notify the Win32 service via a memory mapped file. The downside is
similar to named pipes i.e. no managed implementation yet available in .NET
4. Notify the Win32 service via a custom command.
5. Notify the Win32 service via a local TCP/IP connection
Notifications to the Win32 service may come in bursts of up to 10 at a time
and although I think that custom commands would be the most simple way of
achieving what I want I am not 100% sure whether this method would be
suitable given that the WIn32 service may need to service up to 10 custom
commands in a short period of time. I am not sure if custom commands are
queued if the Win32 service is busy or if they are lost.
Any comments or pointers regarding a suitable solution would be welcomed.
Thanks,
- Clive