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

What is the _state property? #32

Closed
Pinwheeler opened this issue Feb 28, 2020 · 2 comments
Closed

What is the _state property? #32

Pinwheeler opened this issue Feb 28, 2020 · 2 comments
Labels
question Question about any part of the module stale

Comments

@Pinwheeler
Copy link

taking a look at the interface for the TcpSocket object, it features a _state property integer that looks like it might tell me whether or not the socket is successfully connected. Wondering if that's allowed/what the number codes might be for determining that.

@Rapsssito Rapsssito added the question Question about any part of the module label Feb 29, 2020
@Rapsssito
Copy link
Owner

The _state property is a legacy private attribute (note the "_" before its name) from the class TCPSocket. It holds the information about the socket connection state. However, as it is a private property, I do not recommend you to use it, as it might be removed any time soon.

If you still want to use it, theses are the state number codes:

const STATE = {
    DISCONNECTED: 0,
    CONNECTING: 1,
    CONNECTED: 2,
};

If you think that the TCPSocket interface should be enlarge with a public _state getter. Feel free to open an issue for that feature request!

@github-actions
Copy link

github-actions bot commented Apr 1, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community attention? This issue may be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Apr 1, 2020
@github-actions github-actions bot closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about any part of the module stale
Projects
None yet
Development

No branches or pull requests

2 participants