lconnect

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KEEP_ALIVE              = time.Second * 30
	RECONNECT_AFTER_SECONDS = int64(3)
)

Functions

func Server

func Server(addr string, maker HandlerMaker) error

Types

type Client

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

func NewClient

func NewClient(addr string) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Read

func (c *Client) Read() ([]byte, bool)

func (*Client) Write

func (c *Client) Write(data []byte) bool

func (*Client) WriteRead added in v1.0.2

func (c *Client) WriteRead(data []byte) ([]byte, bool)

type Handler

type Handler interface {
	OnMessage([]byte) ([]byte, error)
}

type HandlerMaker

type HandlerMaker func() Handler

Jump to

Keyboard shortcuts

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