Class: Framer

net~Framer(network)

Protocol Message Framer

Constructor

new Framer(network)

Create a framer.

Parameters:
Name Type Description
network Network
Source:

Methods

packet(cmd, payload, checksumnullable) → {Buffer}

Frame a payload with a header.

Parameters:
Name Type Attributes Description
cmd String

Packet type.

payload Buffer
checksum Buffer <nullable>

Precomputed checksum.

Source:
Returns:

Payload with header prepended.

Type
Buffer