Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property to see the status of the server connection #83

Open
krjaction50 opened this issue Oct 26, 2023 · 5 comments
Open

Property to see the status of the server connection #83

krjaction50 opened this issue Oct 26, 2023 · 5 comments

Comments

@krjaction50
Copy link

We've had some network errors where the server-side socket gets closed in our windows service. We have a background that does a lot of housekeeping. I was looking for a property on TcpHost to give me the status of the underlying connection. (open, closed, error, etc). I do not see such a property exposed. This would allow me to keep trying to re-open the server-side connection if it errors out.

@tylerje
Copy link
Member

tylerje commented Nov 3, 2023

You're welcome to submit a PR that does that. My time for maintenance of late has been rather limited.

@tylerje
Copy link
Member

tylerje commented Jan 11, 2024

If time allows, I'll be exploring this as an enhancement.

@krjaction50
Copy link
Author

yeah I just don't have time to do it. It should be very simple from looking at the code. Rarely, we get a disconnect on the server-side and we have no way to recover from that because we have no way to know it happened. We have a background housekeeping thread that runs ever 5 seconds where I could check and if it's disconnected spin up a new server listener.

Thanks

@tylerje
Copy link
Member

tylerje commented Jan 11, 2024

Simple perhaps to give you the status from the host side, but more complex to recover or know this from the client side. One could, if the connection is exposed, even read only, test the state on the host side and re-open the host listener. OR we might be able to have that automatically done using a flag and have the library open a new host/listener if for some reason it has been killed.

@krjaction50
Copy link
Author

This would be a server-side thing only. The client just will error out since the server is no longer listening. We just need a public property on the server-side class that shows the status of the connection/socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants