ws

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 8 Imported by: ? modules, 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

View Source
const (

	// MaxMessageSize limits incoming message size to prevent DoS attacks
	// and expensive EEBUS JSON conversions. Typical SPINE messages are <50KB.
	MaxMessageSize = 100 * 1024 // 100KB

	// DefaultWriteBufferSize is the default size of the write channel buffer.
	// Based on analysis of real-world EEBUS logs, 256 messages provides
	// a good balance between memory usage and handling burst scenarios.
	// Maximum observed burst was 106 messages in 100ms.
	DefaultWriteBufferSize = 256
)

Variables

This section is empty.

Functions

This section is empty.

Types

type WebsocketConnection

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

Handling of the actual websocket connection to a remote device

func NewWebsocketConnection

func NewWebsocketConnection(conn *websocket.Conn, remoteSki string) *WebsocketConnection

create a new websocket based shipDataProcessing implementation

func (*WebsocketConnection) CloseDataConnection

func (w *WebsocketConnection) CloseDataConnection(closeCode int, reason string)

shutdown the connection and all internals

func (*WebsocketConnection) InitDataProcessing

func (w *WebsocketConnection) InitDataProcessing(dataProcessing api.WebsocketDataReaderInterface)

func (*WebsocketConnection) IsDataConnectionClosed

func (w *WebsocketConnection) IsDataConnectionClosed() (bool, error)

return if the connection is closed

func (*WebsocketConnection) WriteMessageToWebsocketConnection

func (w *WebsocketConnection) WriteMessageToWebsocketConnection(message []byte) error

write a message to the websocket connection

Jump to

Keyboard shortcuts

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