Reputation: 887
I am working on a new licensing system for our companies software. We are using DeployLX for out licensing and generally speaking, it meets our needs. One of the options that we want to provide is a Concurrent License where the client can install our software on a server and the user uses our products via a RDP connection. If they have purchased 10 licenses we will allow for 10 instances of our software to be run (on the server)
We have created a Concurrent Monitor in C# to control the license and this works fine if we only need to run our software off 1 server. However, a number of our clients use load balancing in a server farm configurations, so we need we need to install the Configuration Monitor on one server and our software on all the other servers. These servers will need to connect to this one server to contact the Concurrent Monitor and validate the license (which is held against the Concurrent Monitor, not our software).
Currently the Concurrent Monitor is a Windows service installed on a server (server 1). So, how would I code the contact to a method in the Concurrent Monitor from our software product on the other servers (say server 2 and 3)?
I have tried to use the .NET ServiceController and although I can connect to the Windows service, I do not know how (or even if I can) call a method I have written in the service?
Upvotes: 0
Views: 2336
Reputation: 65516
You would be far better to expose the method via a WCF or .net remoting (I'd favour the earlier)
Upvotes: 1
Reputation: 1106
I am not sure about if you can call a method in the service. However, you can achieve the above objective in alternative ways.
i. Let each server write to a standard location the number of connections it is handling. The Concurrent Monitor needs to read this value.
ii.Implement the service as a remoting client, so that the Concurrent Monitor can call this function.
iii. Make the service call to Concurrent Monitor to update the number of connections when ever it changes.
You may choose of this or alternate approaches depending on what easily fits in.
Upvotes: 1