tcp

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

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

ListenAndServe start tcp server closeChan is a channel to close tcp server when closeChan receive a signal, tcp server will close

func ListenAndServeBySignal

func ListenAndServeBySignal(cfg *Config, handler tcpIF.Handler) error

ListenAndServeBySignal start tcp server by signal

Types

type Config

type Config struct {
	Address string
}

type ReplyClient

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

func (*ReplyClient) Close

func (r *ReplyClient) Close() error

Close client connection

type TcpReplyHandler

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

func NewHandler

func NewHandler() *TcpReplyHandler

NewHandler create a new handler

func (*TcpReplyHandler) Close

func (t *TcpReplyHandler) Close() error

Close handler

func (*TcpReplyHandler) Handle

func (t *TcpReplyHandler) Handle(ctx context.Context, conn net.Conn)

Handle client connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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