package
Version:
v0.6.1
Opens a new window with list of versions in this module.
Published: May 19, 2021
License: Apache-2.0, BSD-2-Clause
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package chopper helps splitting messages into smaller pieces and reassemble them
func NumChunks(dataLen, maxMsgSize, includingChoppingOverhead int) (byte, int, error)
NumChunks returns the expected amount of chunks for the given data length
Chopper handles the splitting and joining of large messages
NewChopper creates a new chopper instance
ChopData chops data into pieces (not more than 255) and adds chopper header to each piece
for IncomingChunk function to reassemble it
Close stops the internal cleanup goroutine
IncomingChunk collects all incoming chunks.
Returned != nil value of the reassembled data
maxChunkSize parameter must be the same on both sides
Source Files
¶
Click to show internal directories.
Click to hide internal directories.