simpletcp

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BODY = channel.ReplayState(3)
View Source
const FLAG = channel.ReplayState(1)
View Source
const LENGTH = channel.ReplayState(2)

Variables

This section is empty.

Functions

func VarIntDecode

func VarIntDecode(flag byte, bbf buf.ByteBuf) uint64

func VarIntEncode

func VarIntEncode(val uint64) buf.ByteBuf

Types

type Client

type Client struct {
	AutoReconnect func() bool
	Handler       channel.Handler
	// contains filtered or unexported fields
}

func NewClient

func NewClient(handler channel.Handler) *Client

func (*Client) Channel

func (c *Client) Channel() channel.Channel

func (*Client) Disconnect

func (c *Client) Disconnect() channel.Future

func (*Client) Start

func (c *Client) Start(remoteAddr net.Addr) channel.Channel

func (*Client) Write

func (c *Client) Write(buf buf.ByteBuf) channel.Future

type Server

type Server struct {
	Handler channel.Handler
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler channel.Handler) *Server

func (*Server) Channel

func (s *Server) Channel() channel.Channel

func (*Server) Start

func (s *Server) Start(localAddr net.Addr) channel.Channel

func (*Server) Stop

func (s *Server) Stop() channel.Future

type SimpleCodec

type SimpleCodec struct {
	*channel.ReplayDecoder
	// contains filtered or unexported fields
}

func NewSimpleCodec

func NewSimpleCodec() *SimpleCodec

func (*SimpleCodec) Write

func (h *SimpleCodec) Write(ctx channel.HandlerContext, obj any, future channel.Future)

Jump to

Keyboard shortcuts

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