-
Hi, awesome module! Only one question: How do I know the state of the socket (server-side)? Like, if it's closed or open. |
Beta Was this translation helpful? Give feedback.
Answered by
ghost
Oct 7, 2020
Replies: 1 comment
-
You can't know that. You have to track it. However, in practise you can know because all usage of a closed socket will throw an exception. So either track it yourself or rely on this exception. In C++ you cannot do this, because C++ does not have a garbage collector so the socket dies when it closes so in C++ you have to track it yourself. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can't know that. You have to track it.
However, in practise you can know because all usage of a closed socket will throw an exception. So either track it yourself or rely on this exception.
In C++ you cannot do this, because C++ does not have a garbage collector so the socket dies when it closes so in C++ you have to track it yourself.