Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a peer entry in the peer list

Hierarchy

  • PeerEntry

Index

Constructors

Properties

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

Properties

Protected m_id

m_id: string = ...

Protected m_ip

m_ip: number = 0

Protected m_last_seen

m_last_seen: Date = ...

Protected m_port

m_port: number = 0

Accessors

id

  • get id(): string
  • set id(value: string): void
  • The peer ID

    Returns string

  • The peer ID

    Parameters

    • value: string

    Returns void

ip

  • get ip(): string
  • set ip(value: string): void
  • The peer IP address

    Returns string

  • The peer IP address

    Parameters

    • value: string

    Returns void

last_seen

  • get last_seen(): Date
  • set last_seen(value: Date): void
  • The last seen datetime of the peer

    Returns Date

  • The last seen datetime of the peer

    Parameters

    • value: Date

    Returns void

port

  • get port(): number
  • set port(value: number): void
  • The peer's port number

    Returns number

  • The peer's port number

    Parameters

    • value: number

    Returns void

Methods

toBuffer

  • toBuffer(): Buffer
  • The Buffer representation of the peer entry

    Returns Buffer

    the buffer representation of the object

toString

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

    Returns string

    the hexadecimal (blob) representation of the object

Static from

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

    Parameters

    • data: string | Buffer | Reader

      the raw data of the peer entry

    Returns PeerEntry

    a new instance of the object

Generated using TypeDoc