✅ How to make Event and Delegate to Subscribe to the LocalHost

I am trying to make a c# copy of an existing java program. The individual items I need to capture are clear, but I lack the C# sharp knowledge needed to actually get the program to listen to the local host. My apologies if the problem listed here is vague, but I am lacking some basic knowledge myself.
11 Replies
Anton
Anton2y ago
like listen on a port?
#1AmericanDadFanForLife
yes at the very basic level, I want to be aware when the local host shuts down while the program is running
Anton
Anton2y ago
what do you mean
#1AmericanDadFanForLife
so I have a shell that runs a service on my localhost:8888 if I run the program while the service is up, and then I shut down the service, I want the program to be aware of it I plan to do more, but this basic confirmation that it is listening what I cant figure out
Anton
Anton2y ago
I think you'll need to poll it
#1AmericanDadFanForLife
I am unfamiliar with poll
Anton
Anton2y ago
continuously checking if you can reach the server
#1AmericanDadFanForLife
yes, that sounds perfect
Anton
Anton2y ago
use an HTTP client probably or like a TCP client depends on what the server does
#1AmericanDadFanForLife
the end goal is to have it populate with different objects that behave according to their jars the objects already mapped in java, so moving them over is something i can do but for now I just need to send the C# program to be able to keep track of the service
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server