socket

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 4 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
)

type FuncError

type FuncError func(e error)

type FuncInfo added in v1.11.5

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

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)

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

	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