tcp

package
v0.15.9 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PauseAll added in v0.15.0

func PauseAll(servers []*Server)

func StopAll added in v0.15.0

func StopAll(servers []*Server)

func WaitAll added in v0.15.0

func WaitAll(servers []*Server)

Types

type Client

type Client interface {
	Read() ([]byte, error)
	Unread([]byte)
	Write([]byte) error
	Remote() net.Addr
	Close() error
}

func NewClient

func NewClient(conn net.Conn, timeout time.Duration, buff []byte) Client

type Deadliner added in v0.15.9

type Deadliner interface {
	SetDeadline(t time.Time) error
}

type OnConn added in v0.13.3

type OnConn func(net.Conn)

type Server added in v0.10.1

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

func NewServer added in v0.10.1

func NewServer(sock net.Listener, onConn OnConn) *Server

func (*Server) Pause added in v0.15.0

func (s *Server) Pause()

Pause stops listening to new connections, however doesn't close the socket.

func (*Server) Start added in v0.10.1

func (s *Server) Start() error

Start runs the accept-loop until an error during accepting the connection happens or graceful shutdown invokes

func (*Server) Stop added in v0.10.1

func (s *Server) Stop() error

Stop closes the server socket, however all the clients won't be notified explicitly until they try to send us anything

func (*Server) Wait added in v0.15.0

func (s *Server) Wait()

Wait blocks the caller until all the connections are closed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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