tcp

package
v0.0.0-...-a27ee6b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 9 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 struct {
	Conn   net.Conn
	ReadCh chan []byte
}

func NewClient

func NewClient(uri string) (*Client, error)

NewClient creates a new TCP client

func (*Client) Close

func (c *Client) Close() error

Close - closes the connection

type Server

type Server struct {
	ReadCh chan []byte
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, uri string, log *logger.Logger) (*Server, error)

NewServer creates a new TCP server

func (*Server) Send

func (s *Server) Send(data []byte) error

Send - sends data to all connections

Jump to

Keyboard shortcuts

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