Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Singleton for Host

How to make a singleton for host, not for application only using c#,.Net? Something similar is possible to make via shared memory in C++

like image 533
Yuriy Vikulov Avatar asked Dec 07 '25 09:12

Yuriy Vikulov


1 Answers

If I understand it correctly, what you need can be achieved in the following way: Use the singleton pattern in every application that needs access to the "machine-wide singleton". When a singleton object is created, it should try to connect via .net remoting to a "singleton server" on the local machine. If this fails, it can create one and act as a server.

Is that what you wanted?

like image 85
Philipp Avatar answered Dec 09 '25 22:12

Philipp