Skip to main content

Class: Connection

Internal.Connection

Represents a client that connects to Transformice.

Hierarchy

  • EventEmitter

    Connection

Constructors

constructor

new Connection(): Connection

Constructor.

Returns

Connection

Example

const conn = new Connection(client, 'connectionName');

Overrides

EventEmitter.constructor

Properties

buffer

buffer: Buffer


fingerprint

fingerprint: number


length

length: number


open

open: boolean


socket

socket: Socket

Methods

close

close(): void

Close the connection.

Returns

void


connect

connect(host, port): void

Connects the socket.

Parameters

NameType
hoststring
portnumber

Returns

void


send

send(identifier, packet): void

Sends a packet to the connection.

Parameters

NameTypeDescription
identifierBulleIdentifier-
packetByteArrayThe packet.

Returns

void