segment

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package segment provides functions to segment the binary of ISCP messages in Transport layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendTo

func SendTo(wr Sender, seqNum uint32, msgPayload []byte) (int, error)

Types

type ReadBuffer

type ReadBuffer struct {
	SegCount  int
	MsgSize   int
	Msgs      [][]byte
	ExpiredAt time.Time
}

type ReadBuffers

type ReadBuffers struct {
	sync.Mutex
	ReadBuffer       map[uint32]*ReadBuffer
	ReadBufferExpiry time.Duration
}

func (*ReadBuffers) Receive

func (t *ReadBuffers) Receive(bs []byte) ([]byte, bool, error)

func (*ReadBuffers) RemoveExpired

func (b *ReadBuffers) RemoveExpired()

type Sender

type Sender interface {
	SendMessage([]byte) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL