Constructor
new Framer(network)
Create a framer.
Parameters:
Name | Type | Description |
---|---|---|
network |
Network |
- Source:
Methods
packet(cmd, payload) → {Buffer}
Frame a payload with a header.
Parameters:
Name | Type | Description |
---|---|---|
cmd |
Number | Packet type. |
payload |
Buffer |
- Source:
Returns:
Payload with header prepended.
- Type
- Buffer