Hi,
To check if a service is up, system will establish a TCP connection to the host on the specified port how to do with C#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Jul 16, 2020, 6:19 PM EDT
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 16, 2020, 6:22 PM EDT
Thank you
"Please mark as a answer if it's working for you"
Thilan30 reputationPosted Jul 16, 2020, 7:08 PM EDT
"Design and implement a solution in .net to monitor services. Design and implement in (.net) a service monitoring class. This monitor will be used to monitor the status of multiple services. A service is defined as a host/port combination. To check if a service is up, the monitor will establish a TCP connection to the host on the specified port. If a connection is established, the service is up, if the connection is refused, the service is not up."
Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 16, 2020, 7:15 PM EDT
I have a good option for that
you can create a self host service
Please have a look this link
https://www.c-sharpcorner.com/UploadFile/b1df45/web-api-self-hosting-using-windows-service/
Self hosted service has a hosting and port as well and it works as a service so you can use it as a monitoring purpose
Thank you