Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Connection

The Connection class is a wrapper around asyncio.open_connection.

Subclasses will implement different transport modes as atomic operations, which this class eases doing since the exposed interface simply puts and gets complete data payloads to and from queues.

The only error that will raise from send and receive methods is ConnectionError, which will raise when attempting to send if the client is disconnected (includes remote disconnections).

Hierarchy

  • Connection

Index

Properties

PacketCodecClass?: typeof AbridgedPacketCodec | typeof FullPacketCodec
_ip: string
_port: number
_dcId: number
_log: Logger
_connected: boolean
_codec: any
_obfuscation: any
_sendArray: AsyncQueue
_recvArray: AsyncQueue
sendCancel?: CancellablePromise<any>
_testServers: boolean

Constructors

Methods

  • _connect(): Promise<void>
  • connect(): Promise<void>
  • disconnect(): Promise<void>
  • send(data: Buffer): Promise<void>
  • recv(): Promise<any>
  • _sendLoop(): Promise<void>
  • isConnected(): boolean
  • _recvLoop(): Promise<void>
  • _initConn(): Promise<void>
  • _send(data: Buffer): Promise<void>
  • _recv(): Promise<any>
  • toString(): string

Generated using TypeDoc