gfd

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package gfd provides a structure GFD to store the fd, eventloop index, connStore indexes and some other information.

GFD structure: |eventloop index|conn matrix row index|conn matrix column index|monotone sequence| socket fd | | 1 byte | 1 byte | 2 byte | 4 byte | 8 byte |.

Index

Constants

View Source
const (
	ConnMatrixColumnOffset = 2
	SequenceOffset         = 4
	FdOffset               = 8
	EventLoopIndexMax      = math.MaxUint8 + 1
	ConnMatrixRowMax       = math.MaxUint8 + 1
	ConnMatrixColumnMax    = math.MaxUint16 + 1
)

Constants for GFD.

Variables

This section is empty.

Functions

This section is empty.

Types

type GFD

type GFD [0x10]byte

GFD is a structure to store the fd, eventloop index, connStore indexes.

func NewGFD

func NewGFD(fd, elIndex, row, column int) (gfd GFD)

NewGFD creates a new GFD.

func (GFD) ConnMatrixColumn

func (gfd GFD) ConnMatrixColumn() int

ConnMatrixColumn returns the connMatrix column index.

func (GFD) ConnMatrixRow

func (gfd GFD) ConnMatrixRow() int

ConnMatrixRow returns the connMatrix row index.

func (GFD) EventLoopIndex

func (gfd GFD) EventLoopIndex() int

EventLoopIndex returns the eventloop index.

func (GFD) Fd

func (gfd GFD) Fd() int

Fd returns the underlying fd.

func (GFD) Sequence

func (gfd GFD) Sequence() uint32

Sequence returns the monotonic sequence, only used to prevent fd duplication.

func (*GFD) UpdateIndexes

func (gfd *GFD) UpdateIndexes(row, column int)

UpdateIndexes updates the connStore indexes.

func (GFD) Validate

func (gfd GFD) Validate() bool

Validate checks if the GFD is valid.

Jump to

Keyboard shortcuts

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