tcp

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comm

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

func InitClient

func InitClient(logger *slog.Logger, host string, port int, msgCB MsgCB) (*Comm, error)

func (*Comm) Run

func (c *Comm) Run(ctx context.Context) error

func (*Comm) Send added in v0.2.0

func (c *Comm) Send(msg json.RawMessage) error

type CommCB added in v0.2.0

type CommCB func(ctx context.Context, initF InitCommF)

type InitCommF added in v0.2.0

type InitCommF func(logger *slog.Logger, msgCB MsgCB) *Comm

type MsgCB added in v0.2.0

type MsgCB func(msg json.RawMessage) error

type Server

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

func InitServer

func InitServer(logger *slog.Logger, address string, port int, commCB CommCB) (*Server, error)

func (*Server) Accept

func (s *Server) Accept(ctx context.Context) error

Jump to

Keyboard shortcuts

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