tcp

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickPort

func PickPort() net.Port

PickPort returns an unused TCP port of the system.

func RunSimpleTcpClient

func RunSimpleTcpClient(t *testing.T, ip net.IP, port uint16)

func RunSimpleTcpServer

func RunSimpleTcpServer(t *testing.T) net.Listener

Types

type Server

type Server struct {
	Port         net.Port
	MsgProcessor func(msg []byte) []byte
	ShouldClose  bool
	SendFirst    []byte
	Listen       net.Address

	TlsConfig *tls.Config
	// contains filtered or unexported fields
}

func (*Server) Close

func (server *Server) Close() error

func (*Server) Start

func (server *Server) Start() (net.Destination, error)

func (*Server) StartContext

func (server *Server) StartContext(ctx context.Context, sockopt *dlhelper.SocketSetting) (net.Destination, error)

Jump to

Keyboard shortcuts

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