Documentation
¶
Index ¶
- Constants
- type WebsocketConnection
- func (w *WebsocketConnection) CloseDataConnection(closeCode int, reason string)
- func (w *WebsocketConnection) InitDataProcessing(dataProcessing api.WebsocketDataReaderInterface)
- func (w *WebsocketConnection) IsDataConnectionClosed() (bool, error)
- func (w *WebsocketConnection) WriteMessageToWebsocketConnection(message []byte) error
Constants ¶
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