class

Sellia::Server::ClientConnection

Inherits Reference / Object

Constants

Log = ::Log.for("sellia.server.connection")

Constructors

new(socket : HTTP::WebSocket, id : String = Random::Secure.hex(16))
Source

Instance methods

api_key
Source
api_key=(api_key : String | Nil)
Source
authenticated
Source
authenticated=(authenticated : Bool)
Source
close(reason : String | Nil = nil)
Source
closed?
Source
created_at
Source
created_at=(created_at : Time)
Source
id=(id : String)
Source
last_activity
Source
last_activity=(last_activity : Time)
Source
on_close
Source
on_message
Source
ping

Send a ping message

Source
send(message : Protocol::Message) : Bool
Source
socket
Source
socket=(socket : HTTP::WebSocket)
Source
stale?(timeout : Time::Span = 60.seconds) : Bool

Check if connection is stale (no activity within timeout)

Source