gwebsocket

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 6 Imported by: 0

README

gwebsocket

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnexpectedMsgType is returned when a reader is returned by the websocket
	// connection that does not match the message type NetConn was created with
	ErrUnexpectedMsgType = errors.New("unexpected message type")
)

Functions

This section is empty.

Types

type NetConn

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

func NewNetConn

func NewNetConn(wsConn *websocket.Conn, msgType int) *NetConn

NewNetConn returns a NetConn pointer. It takes a gorilla websocket connection and a message type. See: https://github.com/gorilla/websocket/blob/v1.4.2/conn.go#L62 for possible values

func (*NetConn) Close

func (c *NetConn) Close() error

func (*NetConn) LocalAddr

func (c *NetConn) LocalAddr() net.Addr

func (*NetConn) Read

func (c *NetConn) Read(b []byte) (int, error)

func (*NetConn) RemoteAddr

func (c *NetConn) RemoteAddr() net.Addr

func (*NetConn) SetDeadline

func (c *NetConn) SetDeadline(t time.Time) error

func (*NetConn) SetReadDeadline

func (c *NetConn) SetReadDeadline(t time.Time) error

func (*NetConn) SetWriteDeadline

func (c *NetConn) SetWriteDeadline(t time.Time) error

func (*NetConn) Write

func (c *NetConn) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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