Class: Framer

net.Framer

new Framer(network)

Protocol packet framer

Parameters:
Name Type Description
network Network
Source:

Methods

packet(cmd, payload) → {Buffer}

Frame a payload with a header.

Parameters:
Name Type Description
cmd String

Packet type.

payload Buffer
Source:
Returns:

Payload with header prepended.

Type
Buffer