socket

package
v1.13.5 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBufferSize = 32 * 1024

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 {
	RegisterFuncError(f FuncError)
	RegisterFuncInfo(f FuncInfo)
	RegisterFuncInfoServer(f FuncInfoSrv)

	SetReadTimeout(d time.Duration)
	SetWriteTimeout(d time.Duration)

	SetTLS(enable bool, config libtls.TLSConfig) error
	Listen(ctx context.Context) error
	Shutdown()
	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