The most recent state of the connection. Used by checkForStateChange to determine if a state change event needs to be emitted.
The underlying socket connection. Only defined when the connection
is active (not Disconnected
).
Do not set this directly -- use setSocket
The current options being used for this connection.
The current state of the connection.
Checks to see if the current connection state has changed and emits the appropriate event if it has.
Attempst to connect to the Elk M1 This should only be called when the connection is in a disconnected state, otherwise it will fail with a NotConnectableError
How long to wait for a connection to be established, after which the connect() call will fail.
Disconnect the current socket connection.
How long to wait before forcefully disconnecting.
Called when the socket is completely closed.
Called when the socket emits it's "connect" event.
Called when the socket emits a "data" event.
Called when the M1 closes the connection.
Called when the underlying socket emits an error event.
Called when the underlying socket has no activity within the idleTimeout
time. This will cause the socket to be disconnected.
Sets the underlying socket being used by the connection.
Sends data to the Elk M1. Typically this is an Elk Message packet (but can also be arbitrary data, as is the case when authenticating).
Generated using TypeDoc
A connection to an Elk M1 via a TCP socket.