tcp

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT-0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTCPServerConfig = TCPServerConfig{
	ReadBufferSize: 1024,
}

Functions

This section is empty.

Types

type TCPServer

type TCPServer struct {
	// contains filtered or unexported fields
}

func NewTCPServer

func NewTCPServer(config ...TCPServerConfig) *TCPServer

func (*TCPServer) Listen

func (t *TCPServer) Listen(network, address string) (net.Listener, error)

func (*TCPServer) OnRead

func (t *TCPServer) OnRead(onread func(conn net.Conn, data []byte))

func (*TCPServer) Write

func (t *TCPServer) Write(conn net.Conn, data []byte)

type TCPServerConfig

type TCPServerConfig struct {
	ReadBufferSize int
}

Jump to

Keyboard shortcuts

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