Yuriy Vikulov
Yuriy Vikulov

Reputation: 2499

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++

Upvotes: 3

Views: 332

Answers (1)

Philipp
Philipp

Reputation: 11833

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?

Upvotes: 2

Related Questions