cutter
A cutter for head-body buffer.
Many network protocol will use packets composed of a fixed length "head" and a variable length "body", the "data" event emitted by node socket probably not a complete packet, but part of several packets. So this cutter
will help to get packets.
Usage
var Cutter = ;var net = ; /** * must return length of head + body */ { return 4 + data0 + data1 << 8 + data2 << 16;} var server = net; server;
Error Event
When cutter parse packet error, it will emit an error event.
Installation
$ npm install cutter --save
License
The MIT license