0

I have a question regarding a Windows C# services. Is it possible for the window service to run in background and send/Receive its data to a C# standalone application with opened by a user. if so how is it that it can be done? Is there any other better ways for building a window service

anilG
  • 19
  • 8

2 Answers2

1

Yes this can be done, and there are several options. For inter-process communication - which is basically what you are asking for - you could consider WCF with NamedPipes or TCP, or a message queue (MSMQ, RabbitMQ etc).

Typically with a message queue the messages will queue if the service or client is not there, or with named pipes or TCP a current connection must be available.

WCF named pipe minimal example

Community
  • 1
  • 1
James Willock
  • 1,999
  • 14
  • 17
  • RabbitMQ is free and a great tool. Been using it in production for routing messages for about 4 years with not a single issue. But if you just need to send to just a single client it's probably a bit overkill, as it really shines when routing messages to multiple clients. – Kelly Feb 02 '16 at 12:48
0

Yes, it's possible. You can run a service like windows service, expose methods, and one or more client can use it.

One example is this.

Bye bye.

Max
  • 246
  • 5
  • 12