Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadTlvStream ¶
func ReadTlvStream( reader io.Reader, onFrame func([]byte) bool, ignoreError func(error) bool, ) error
(AI GENERATED DESCRIPTION): Continuously reads TLV‑encoded packets from an io.Reader, buffering partial data and invoking a callback for each complete frame while handling errors and optional early termination.
Types ¶
type TimedWriter ¶
TimedWriter is a buffered writer that flushes automatically when a deadline is set and the deadline is exceeded.
func NewTimedWriter ¶
func NewTimedWriter(io io.Writer, bufsize int) *TimedWriter
(AI GENERATED DESCRIPTION): Creates a TimedWriter that wraps the supplied io.Writer in a buffered writer of the given size and initializes it with a 1‑millisecond deadline and a maximum flush queue of 8.
func (*TimedWriter) Flush ¶
func (w *TimedWriter) Flush() error
(AI GENERATED DESCRIPTION): Flush acquires the TimedWriter’s mutex, invokes its internal flush routine, and returns any error that occurs.
func (*TimedWriter) SetDeadline ¶
func (w *TimedWriter) SetDeadline(d time.Duration)
(AI GENERATED DESCRIPTION): Sets the deadline duration that the TimedWriter will use for its timed operations.
func (*TimedWriter) SetMaxQueue ¶
func (w *TimedWriter) SetMaxQueue(s int)
(AI GENERATED DESCRIPTION): Sets the maximum number of packets the TimedWriter can buffer in its internal queue.
func (*TimedWriter) Write ¶
func (w *TimedWriter) Write(p []byte) (n int, err error)
(AI GENERATED DESCRIPTION): Writes data to the underlying writer, buffering until the queued size reaches the maximum or the deadline expires, then flushes the buffer (or returns any stored previous error) while ensuring thread‑safety.