tcp

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(listener net.Listener, handler tcp.Handler, closeChan <-chan struct{})

func ListenAndServeWithSignal

func ListenAndServeWithSignal(cfg *Config, handler tcp.Handler) error

Types

type Client

type Client struct {
	Conn    net.Conn
	Waiting wait.Wait
}

func (*Client) Close

func (c *Client) Close() error

type Config

type Config struct {
	Address    string        `yaml:"address"`
	MaxConnect uint32        `yaml:"max-connect"`
	Timeout    time.Duration `yaml:"timeout"`
}

type EchoHandler

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

func MakeEchoHandler

func MakeEchoHandler() *EchoHandler

func (*EchoHandler) Close

func (h *EchoHandler) Close() error

func (*EchoHandler) Handle

func (h *EchoHandler) Handle(ctx context.Context, conn net.Conn)

Jump to

Keyboard shortcuts

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