Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection interface { // Send sends a message Send(msgType int, data []byte) error // Conn gives access to the underlying connection Conn() *websocket.Conn // Close closes the connection Close() // String address of remote endpoint (e.g. "192.0.2.1:25" or "[2001:db8::1]:80") String() string }
Connection represents a connected websocket.
func NewConnection ¶
func NewConnection(conn *websocket.Conn, onMessage func(this Connection, msgType int, data []byte), onClose func(this Connection, code int, text string), onError func(this Connection, err error)) Connection
Click to show internal directories.
Click to hide internal directories.