websocket

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package websocket provides WebSocket connectivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerConn

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

ServerConn is a server-side WebSocket connection with automatic, periodic ping-pong

func NewServerConn

func NewServerConn(w http.ResponseWriter, req *http.Request) (*ServerConn, error)

NewServerConn allocates a ServerConn.

func (*ServerConn) Close

func (c *ServerConn) Close()

Close closes a ServerConn.

func (*ServerConn) ReadJSON

func (c *ServerConn) ReadJSON(in interface{}) error

ReadJSON reads a JSON object.

func (*ServerConn) RemoteAddr

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

RemoteAddr returns the remote address.

func (*ServerConn) WriteJSON

func (c *ServerConn) WriteJSON(in interface{}) error

WriteJSON writes a JSON object.

Jump to

Keyboard shortcuts

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