util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	*websocket.Conn
	// contains filtered or unexported fields
}

Conn represents a client WebSocket connection. An added lock guards the underlying connection from concurrent write to websocket connection errors.

func NewConn

func NewConn(conn *websocket.Conn) *Conn

NewConn wraps a WebSocket connection.

func (*Conn) ReadMessage

func (c *Conn) ReadMessage() (int, []byte, error)

ReadMessage reads a message from the client connection with proper locking.

func (*Conn) WriteMessage

func (c *Conn) WriteMessage(messageType int, data []byte) error

WriteMessage writes a message to the client connection with proper locking.

Jump to

Keyboard shortcuts

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