Class: RCONConnection

RCONConnection

Represents a single RCON server connection.

new RCONConnection(options)

Name Type Description
options Object

The initialization options.

Name Type Description
client RCONClient

The parent RCON client instance.

Extends

  • EventEmitter

Members

authTokenstring null

client

consecutiveTimeoutsnumber

hoststring

maxConsecutiveTimeoutsnumber

maxMessagesInAirnumber

messagesInAirnumber

passwordstring

portnumber

receiveBufferBuffer

requestCacheRecord.<number, RequestCacheItem>

socketnet.Socket

transmitMessageIndexnumber

xorKeyBuffer null

Methods

Closes the socket.

flushPendingRequests(error)

Resolves all pending requests with an error.

Name Type Description
error string

asyncsend(message, options){Promise.<ResponseMessage>}

Constructs and sends a RequestMessage to the RCON server.

Name Type Description
message Object

The message payload.

Name Type Description
name string

The command or action name.

contentBody Object | string optional

The body content of the message.

options Object optional

Transmission configuration.

Name Type Default Description
encrypt boolean true optional

Whether to send the buffer encrypted.

timeout number 10000 optional

Message timeout.

Returns:
Type Description
Promise.<ResponseMessage> The resolved response from the server.