client

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SocketNil = errors.New("the socket is nil")

Functions

This section is empty.

Types

type Client

type Client struct {
	Packer         roc.PackerInterface
	IdGenerator    roc.IdGeneratorInterface
	Serializer     serializer.SerializerInterface
	PushChan       chan string
	ChannelManager *roc.ChannelManager
	Socket         net.Conn
	Addr           net.Addr
}

func NewAddrClient

func NewAddrClient(addr net.Addr) (*Client, error)

func NewClient

func NewClient(conn net.Conn) *Client

func NewLazyClient added in v0.4.1

func NewLazyClient(conn net.Conn, Addr net.Addr) *Client

func NewTcpClient

func NewTcpClient(address string) (*Client, error)

func (*Client) FreshSocket

func (c *Client) FreshSocket() error

func (*Client) Loop

func (c *Client) Loop()

func (*Client) Recv

func (c *Client) Recv(id uint32, ret interface{}, option *RecvOption) exception.ExceptionInterface

func (*Client) SendPacket

func (c *Client) SendPacket(p *roc.Packet) (uint32, error)

func (*Client) SendRequest

func (c *Client) SendRequest(path string, r json.Marshaler) (uint32, error)

type RecvOption added in v0.3.1

type RecvOption struct {
	Timeout time.Duration
}

func NewDefaultRecvOption added in v0.3.1

func NewDefaultRecvOption() *RecvOption

type TCPAddr added in v0.4.1

type TCPAddr struct {
	Addr string
}

func (TCPAddr) Network added in v0.4.1

func (l TCPAddr) Network() string

func (TCPAddr) String added in v0.4.1

func (l TCPAddr) String() string

Jump to

Keyboard shortcuts

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