ws_native

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConnected = errors.New("socket connection is not initialized")

Functions

This section is empty.

Types

type WebSocketConnection

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

func (*WebSocketConnection) Close

func (ws *WebSocketConnection) Close() error

func (*WebSocketConnection) Dial

func (ws *WebSocketConnection) Dial(ctx context.Context, url *url.URL, origin *url.URL) error

func (*WebSocketConnection) Receive

func (ws *WebSocketConnection) Receive(v *[]byte) error

func (*WebSocketConnection) ReceiveFrame added in v0.2.0

func (ws *WebSocketConnection) ReceiveFrame(v *[]byte) (isBinary bool, err error)

ReceiveFrame reads the next frame and reports whether it was a binary frame (opcode 2). It uses a codec that preserves the payload type so the caller can distinguish binary attachments from text packets, which the default websocket.Message codec collapses. Text and binary frames are both returned as raw bytes in *v.

func (*WebSocketConnection) Send

func (ws *WebSocketConnection) Send(v []byte) error

func (*WebSocketConnection) SendBinary added in v0.2.0

func (ws *WebSocketConnection) SendBinary(v []byte) error

SendBinary writes v as a WebSocket binary frame (opcode 2). Engine.io v4 carries socket.io binary attachments as binary frames over websocket.

Jump to

Keyboard shortcuts

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