server

package
v0.0.0-...-fc60ad2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

type Server

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

func NewServer

func NewServer(settings Settings) (*Server, error)

func (*Server) Accept

func (s *Server) Accept() (string, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) GetConnection

func (s *Server) GetConnection(id string) (net.Conn, error)

func (*Server) RemoveConnection

func (s *Server) RemoveConnection(id string) error

func (*Server) Send

func (s *Server) Send(id string, payload []byte) error

func (*Server) SetConnection

func (s *Server) SetConnection(conn net.Conn) (string, error)

func (*Server) SetOnConnect

func (s *Server) SetOnConnect(f func(id string))

func (*Server) SetOnData

func (s *Server) SetOnData(f func(id string, payload []byte))

func (*Server) SetOnDisconnect

func (s *Server) SetOnDisconnect(f func(id string))

func (*Server) SetOnError

func (s *Server) SetOnError(f func(id string, err error))

type Settings

type Settings struct {
	Addr                 net.TCPAddr
	UseTLS               bool
	Cert                 tls.Certificate
	Timeout              uint32
	MaxFrameBytes        uint32
	MaxDecompressedBytes uint32
	ZipThreshold         uint32
}

Jump to

Keyboard shortcuts

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