Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandshakeError ¶
Dial error as websockets connect raises it, a refused upgrade naming the HTTP status it got
func IsClosedOK ¶
Whether an error is the clean closure that ends iteration over a connection without raising
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
One open client connection with its close record, reader and keepalive
func Connect ¶
Opens a client connection the way websockets connect does, the opening handshake bounded by the open timeout
func (*Conn) Close ¶
func (c *Conn) Close()
Runs the closing handshake with code 1000 bounded by the close timeout, then drops the TCP connection
func (*Conn) Ping ¶
Sends one ping frame with a random payload, ConnectionClosed when the connection already ended or the write fails
func (*Conn) Recv ¶
Next message, a text frame as a string and a binary frame as bytes, ConnectionClosed once the connection ended
type ConnectOptions ¶
type ConnectOptions struct {
OpenTimeout time.Duration
CloseTimeout time.Duration
PingInterval time.Duration
PingTimeout time.Duration
MaxSize int64
HappyEyeballsDelay time.Duration
// Keepalive pings off, the ping_interval None of websockets connect
NoKeepalive bool
}
Keyword arguments of websockets connect, a zero field taking the library default
type ConnectionClosed ¶
Interaction with a closed connection, carrying the close frames received and sent and their order
func (*ConnectionClosed) Error ¶
func (e *ConnectionClosed) Error() string
func (*ConnectionClosed) PyTypeName ¶
func (e *ConnectionClosed) PyTypeName() string
ConnectionClosedOK when both frames carry a clean code, ConnectionClosedError otherwise
type DialError ¶
type DialError struct{ Text string }
Failed TCP connect carrying the str of the OSError asyncio create_connection raises
func (*DialError) PyTypeName ¶
type InvalidStatus ¶
type InvalidStatus struct{ StatusCode int }
Handshake the server answered with a non 101 HTTP status, the websockets InvalidStatus exception
func (*InvalidStatus) Error ¶
func (e *InvalidStatus) Error() string
func (*InvalidStatus) PyTypeName ¶
func (e *InvalidStatus) PyTypeName() string
func (*InvalidStatus) Unwrap ¶
func (e *InvalidStatus) Unwrap() error
type InvalidURI ¶
type InvalidURI struct{ URI, Msg string }
URI the client refuses before dialing, the websockets InvalidURI exception
func (*InvalidURI) Error ¶
func (e *InvalidURI) Error() string
func (*InvalidURI) PyTypeName ¶
func (e *InvalidURI) PyTypeName() string
type OpenTimeoutError ¶
type OpenTimeoutError struct{}
Opening handshake that outlasted the open timeout, the TimeoutError websockets connect raises
func (*OpenTimeoutError) Error ¶
func (e *OpenTimeoutError) Error() string
func (*OpenTimeoutError) PyTypeName ¶
func (e *OpenTimeoutError) PyTypeName() string