socket

package
v1.13.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBufferSize = 32 * 1024
View Source
const EOL byte = '\n'

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.11.5

type Client interface {
	RegisterFuncError(f FuncError)
	RegisterFuncInfo(f FuncInfo)

	Do(ctx context.Context, request io.Reader, fct Response) error
}

type ConnState added in v1.11.5

type ConnState uint8
const (
	ConnectionDial ConnState = iota
	ConnectionNew
	ConnectionRead
	ConnectionCloseRead
	ConnectionHandler
	ConnectionWrite
	ConnectionCloseWrite
	ConnectionClose
)

func (ConnState) String added in v1.13.1

func (c ConnState) String() string

type FuncError

type FuncError func(e error)

type FuncInfo added in v1.11.5

type FuncInfo func(local, remote net.Addr, state ConnState)

type FuncInfoSrv added in v1.13.1

type FuncInfoSrv func(msg string)

type Handler

type Handler func(request io.Reader, response io.Writer)

type Response added in v1.12.2

type Response func(r io.Reader)

type Server

type Server interface {
	io.Closer

	RegisterFuncError(f FuncError)
	RegisterFuncInfo(f FuncInfo)
	RegisterFuncInfoServer(f FuncInfoSrv)

	SetTLS(enable bool, config libtls.TLSConfig) error
	Listen(ctx context.Context) error
	Shutdown() error
	IsRunning() bool
	Done() <-chan struct{}
}

Directories

Path Synopsis
tcp
udp
tcp
udp

Jump to

Keyboard shortcuts

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