Class: Connection
Internal.Connection
Represents a client that connects to Transformice.
Hierarchy
EventEmitter
↳
Connection
Constructors
constructor
• new Connection(): Connection
Constructor.
Returns
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
Name | Type |
---|---|
host | string |
port | number |
Returns
void
send
▸ send(identifier
, packet
): void
Sends a packet to the connection.
Parameters
Name | Type | Description |
---|---|---|
identifier | BulleIdentifier | - |
packet | ByteArray | The packet. |
Returns
void