system

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

README

MISC

check os, cpu

NET

tcp defer accept reuseport tcp cork

PROC

daemonize cpu affinity

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExePath string
	ExeDir  string
)

Functions

func Advise

func Advise()

func Check

func Check() bool

func DaemonInit

func DaemonInit()

func DaemonSysAttr

func DaemonSysAttr() *syscall.SysProcAttr

func SetAffinity

func SetAffinity(pid int, cpu int) bool

func SetBuffered

func SetBuffered(rawConn syscall.RawConn, buffered bool)

func SetDeferAccept

func SetDeferAccept(rawConn syscall.RawConn) (err error)

func SetReusePort

func SetReusePort(rawConn syscall.RawConn) (err error)

Types

type TCPInfo

type TCPInfo struct {
	State TCPState
}

TCPInfo TCP statistics for a specified socket. link: /usr/include/netinet/tcp.h

func GetTCPInfo

func GetTCPInfo(sockfd uintptr) (*TCPInfo, error)

func (*TCPInfo) CanWrite

func (t *TCPInfo) CanWrite() bool

func (*TCPInfo) IsEstablished

func (t *TCPInfo) IsEstablished() bool

type TCPState

type TCPState uint8

TCPState TCP FSM state link: /usr/include/netinet/tcp.h

const (
	TCPStateEstablished TCPState
	TCPStateSynSent
	TCPStateSynRcvd
	TCPStateFinWait1
	TCPStateFinWait2
	TCPStateTimeWait
	TCPStateClosed
	TCPStateCloseWait
	TCPStateLastAck
	TCPStateListen
	TCPStateClosing
)

Jump to

Keyboard shortcuts

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