Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PeerEntry

Represents a peer entry in the peer list

Hierarchy

  • PeerEntry

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new PeerEntry(ip: string, port: number, id: string, last_seen: Date): PeerEntry
  • Constructs a new peer entry using the supplied values

    Parameters

    • ip: string

      the peer ip address

    • port: number

      the peer port

    • id: string

      the peer id

    • last_seen: Date

      the date the peer was last seen

    Returns PeerEntry

Accessors

id

  • get id(): string
  • set id(value: string): void

ip

  • get ip(): string
  • set ip(value: string): void

last_seen

  • get last_seen(): Date
  • set last_seen(value: Date): void

port

  • get port(): number
  • set port(value: number): void

Methods

toBuffer

  • toBuffer(): Buffer

toString

  • toString(): string
  • The hexadecimal (blob) representation of the peer entry

    Returns string

    the hexadecimal (blob) representation of the object

Static from

  • from(data: Reader | Buffer | string): PeerEntry
  • Creates a new peer entry instance using the supplied data

    Parameters

    • data: Reader | Buffer | string

      the raw data of the peer entry

    Returns PeerEntry

    a new instance of the object

Generated using TypeDoc