sut

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGlobalSock

func AddGlobalSock(socketFD SocketFD, remoteAddr net.TCPAddr, isServer bool)

AddGlobalSock add socket, case: Accept、Connect

func OperateThread

func OperateThread(threadID ThreadID, op func(thread *Thread))

OperateThread create when session notExist

func OperateThreadOnRecordingSession

func OperateThreadOnRecordingSession(threadID ThreadID, op func(thread *Thread))

OperateThreadOnRecordingSession only on RecordingSession

func RemoveGlobalSock

func RemoveGlobalSock(socketFD SocketFD)

RemoveGlobalSock rm socket, case: Close

func StartGC added in v0.0.7

func StartGC()

StartGC gc global socket and thread

Types

type RecvFlags

type RecvFlags int

RecvFlags RecvFlags

type SocketFD

type SocketFD int

SocketFD SocketFD

type Thread

type Thread struct {
	context.Context
	// contains filtered or unexported fields
}

Thread Thread

func (*Thread) IgnoreSocketFD

func (thread *Thread) IgnoreSocketFD(socketFD SocketFD, remoteAddr net.TCPAddr)

IgnoreSocketFD IgnoreSocketFD

func (*Thread) OnAccept

func (thread *Thread) OnAccept(serverSocketFD SocketFD, clientSocketFD SocketFD, addr net.TCPAddr)

OnAccept OnAccept

func (*Thread) OnAccess

func (thread *Thread) OnAccess()

OnAccess check action limit, max = 1000

func (*Thread) OnConnect

func (thread *Thread) OnConnect(socketFD SocketFD, remoteAddr net.TCPAddr)

OnConnect add global socketFD

func (*Thread) OnRecv

func (thread *Thread) OnRecv(socketFD SocketFD, span []byte, flags RecvFlags) []byte

OnRecv OnRecv

func (*Thread) OnSend

func (thread *Thread) OnSend(socketFD SocketFD, span []byte, extraHeaderSentSize int, raddr net.Addr)

OnSend OnSend

func (*Thread) OnSendTo

func (thread *Thread) OnSendTo(socketFD SocketFD, span []byte, addr net.UDPAddr)

OnSendTo OnSendTo

func (*Thread) OnShutdown

func (thread *Thread) OnShutdown()

OnShutdown OnShutdown

type ThreadID

type ThreadID int32

ThreadID ThreadID

type ThreadIDKey

type ThreadIDKey string

ThreadIDKey ThreadIDKey

Jump to

Keyboard shortcuts

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