sharing info with other programs
-
I have a TCP/IP server (VB .net 2.0 Windows App) that accepts connections from clients receives a string from them and passes back an answer. The TCP/IP Server creates a thread for each connection and that thread handles that connection then terminates. Each of these connection threads increments a counter class when it starts and decrements it when it finishes. The main thread in the TCP/IP server program queries the value of the counter class periodically to see how many threads are being handled at that time. This is working perfectly and has been for well over a year. Now, I need to share the value of this counter with other programs. In specific we are going to start using Microsoft's System Center Manager to monitor and alert of potential problems etc. After a discussion with my Boss it is clear that he would like a way to reach into my program and pull this value vs. having my program write it to an environment variable or even a file that could be read. I think this should be doable but I'm not sure exactly what I should be looking to do. Keep in mind the TCP/IP server is a Windows App. Any advise would be appreciated.
-
I have a TCP/IP server (VB .net 2.0 Windows App) that accepts connections from clients receives a string from them and passes back an answer. The TCP/IP Server creates a thread for each connection and that thread handles that connection then terminates. Each of these connection threads increments a counter class when it starts and decrements it when it finishes. The main thread in the TCP/IP server program queries the value of the counter class periodically to see how many threads are being handled at that time. This is working perfectly and has been for well over a year. Now, I need to share the value of this counter with other programs. In specific we are going to start using Microsoft's System Center Manager to monitor and alert of potential problems etc. After a discussion with my Boss it is clear that he would like a way to reach into my program and pull this value vs. having my program write it to an environment variable or even a file that could be read. I think this should be doable but I'm not sure exactly what I should be looking to do. Keep in mind the TCP/IP server is a Windows App. Any advise would be appreciated.
There's a bunch of different ways of doing this, depending on your environment. Probably the best way to do it is to change the server code to expose the number you were talking about as a PerformanceCounter. Other programs can then use the performance counter information to get the current count. An Introduction To Performance Counters[^]. The code is in C#, but is easily translatable to VB.NET.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
There's a bunch of different ways of doing this, depending on your environment. Probably the best way to do it is to change the server code to expose the number you were talking about as a PerformanceCounter. Other programs can then use the performance counter information to get the current count. An Introduction To Performance Counters[^]. The code is in C#, but is easily translatable to VB.NET.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Nope. But WMI has it's option too, where you're able to create a custom class to do this. It's more work than creating a PerformanceCounter implementation though.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Nope. But WMI has it's option too, where you're able to create a custom class to do this. It's more work than creating a PerformanceCounter implementation though.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007