tcp

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 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 onConnection) *Server

func (*Server) GracefulShutdown added in v0.10.1

func (s *Server) GracefulShutdown() error

GracefulShutdown stops a listener, but leaving all the connections free to end their lives peacefully

func (*Server) Start added in v0.10.1

func (s *Server) Start() error

func (*Server) Stop added in v0.10.1

func (s *Server) Stop() error

Stop shuts listener and ALL the connections down

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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