Options
All
  • Public
  • Public/Protected
  • All
Menu

pinus-protocol

Index

Variables

Buffer

Buffer: any

MSG_COMPRESS_GZIP_ENCODE_MASK

MSG_COMPRESS_GZIP_ENCODE_MASK: number = 1 << 4

MSG_COMPRESS_GZIP_MASK

MSG_COMPRESS_GZIP_MASK: number = 1

MSG_COMPRESS_ROUTE_MASK

MSG_COMPRESS_ROUTE_MASK: number = 1

MSG_FLAG_BYTES

MSG_FLAG_BYTES: number = 1

MSG_ID_MAX_BYTES

MSG_ID_MAX_BYTES: number = 5

MSG_ROUTE_CODE_BYTES

MSG_ROUTE_CODE_BYTES: number = 2

MSG_ROUTE_CODE_MAX

MSG_ROUTE_CODE_MAX: number = 65535

MSG_ROUTE_LEN_BYTES

MSG_ROUTE_LEN_BYTES: number = 1

MSG_TYPE_MASK

MSG_TYPE_MASK: number = 7

PKG_HEAD_BYTES

PKG_HEAD_BYTES: number = 4

Functions

caculateMsgIdBytes

  • caculateMsgIdBytes(id: number): number

copyArray

  • copyArray(dest: Buffer, doffset: number, src: Buffer, soffset: number, length: number): void
  • Parameters

    • dest: Buffer
    • doffset: number
    • src: Buffer
    • soffset: number
    • length: number

    Returns void

encodeMsgBody

  • encodeMsgBody(msg: Buffer, buffer: Buffer, offset: number): number
  • Parameters

    • msg: Buffer
    • buffer: Buffer
    • offset: number

    Returns number

encodeMsgFlag

  • encodeMsgFlag(type: number, compressRoute: boolean, buffer: Buffer, offset: number, compressGzip: boolean): number
  • Parameters

    • type: number
    • compressRoute: boolean
    • buffer: Buffer
    • offset: number
    • compressGzip: boolean

    Returns number

encodeMsgId

  • encodeMsgId(id: number, buffer: Buffer, offset: number): number
  • Parameters

    • id: number
    • buffer: Buffer
    • offset: number

    Returns number

encodeMsgRoute

  • encodeMsgRoute(compressRoute: boolean, _route: number | string | Buffer, buffer: Buffer, offset: number): number
  • Parameters

    • compressRoute: boolean
    • _route: number | string | Buffer
    • buffer: Buffer
    • offset: number

    Returns number

msgHasId

  • msgHasId(type: number): boolean

msgHasRoute

  • msgHasRoute(type: number): boolean