ws

package
v0.0.0-...-78613ec Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WSClient

type WSClient struct {
	sync.Mutex
	Addr             string
	ConnNum          int
	ConnectInterval  time.Duration
	PendingWriteNum  int
	MaxMsgLen        uint32
	HandshakeTimeout time.Duration
	AutoReconnect    bool
	NewAgent         func(*WSConn) network.Agent
	// contains filtered or unexported fields
}

func (*WSClient) Close

func (client *WSClient) Close()

func (*WSClient) Start

func (client *WSClient) Start()

type WSConn

type WSConn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*WSConn) Close

func (wsConn *WSConn) Close()

func (*WSConn) Destroy

func (wsConn *WSConn) Destroy()

func (*WSConn) LocalAddr

func (wsConn *WSConn) LocalAddr() net.Addr

func (*WSConn) ReadMsg

func (wsConn *WSConn) ReadMsg() ([]byte, error)

goroutine not safe

func (*WSConn) RemoteAddr

func (wsConn *WSConn) RemoteAddr() net.Addr

func (*WSConn) WriteMsg

func (wsConn *WSConn) WriteMsg(args ...[]byte) error

args must not be modified by the others goroutines

type WSHandler

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

func (*WSHandler) ServeHTTP

func (handler *WSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WSServer

type WSServer struct {
	Addr            string
	MaxConnNum      int
	PendingWriteNum int
	MaxMsgLen       uint32
	HTTPTimeout     time.Duration
	CertFile        string
	KeyFile         string
	NewAgent        func(*WSConn) network.Agent
	// contains filtered or unexported fields
}

func (*WSServer) Close

func (server *WSServer) Close()

func (*WSServer) Start

func (server *WSServer) Start()

type WebsocketConnSet

type WebsocketConnSet map[*websocket.Conn]struct{}

Jump to

Keyboard shortcuts

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