The lichat-ws-server Reference Manual
This is the lichat-ws-server Reference Manual, version 1.0.0,
generated automatically by Declt version 4.0 beta 2 "William Riker"
on Sun Dec 15 06:37:09 2024 GMT+0.
2 Systems
The main system appears first, followed by any subsystem dependency.
3 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
4 Packages
Packages are listed by definition order.
4.1 lichat-ws-server
- Source
package.lisp
.
- Nickname
org.shirakumo.lichat.ws-server
- Use List
common-lisp
.
- Public Interface
-
- Internals
-
5 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
5.1 Public Interface
5.1.1 Special variables
- Special Variable: *default-port* ¶
-
The standard port on which the server will run.
Should be 1113.
- Package
lichat-ws-server
.
- Source
server.lisp
.
5.1.2 Generic functions
- Generic Function: close-connection (server) ¶
-
Stop accepting incoming connections and close all existing ones.
See CONNECTIONS
See THREAD
See SERVER
- Package
lichat-ws-server
.
- Methods
- Method: close-connection ((server
server
)) ¶
-
- Source
server.lisp
.
- Generic Reader: connection-limit (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Reader Method: connection-limit ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
connection-limit
.
- Generic Writer: (setf connection-limit) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf connection-limit) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
connection-limit
.
- Generic Reader: connections (object) ¶
-
Accessor to the list of connections on the server.
See SERVER
See CONNECTION
- Package
lichat-ws-server
.
- Methods
- Reader Method: connections ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
connections
.
- Generic Writer: (setf connections) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf connections) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
connections
.
- Generic Function: handle-pings (server) ¶
-
This function will loop on the server and send ping requests in a regular interval to clients that have not replied in a while.
During the processing a restart called STOP-HANDLING
is active that, when invoked, exits the function.
See PING-INTERVAL
See SERVER
- Package
lichat-ws-server
.
- Methods
- Method: handle-pings ((server
server
)) ¶
-
- Source
server.lisp
.
- Generic Reader: hostname (object) ¶
-
Accessor to the hostname of the object.
See SERVER
- Package
lichat-ws-server
.
- Methods
- Reader Method: hostname ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
hostname
.
- Generic Writer: (setf hostname) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf hostname) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
hostname
.
- Generic Reader: lock (object) ¶
-
Accessor to the lock of the object that is used to mutually exclude access.
See SERVER
See CONNECTION
See USER
See CHANNEL
- Package
lichat-ws-server
.
- Methods
- Reader Method: lock ((user
user
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
lock
.
- Reader Method: lock ((channel
channel
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
lock
.
- Reader Method: lock ((connection
connection
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
lock
.
- Reader Method: lock ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
lock
.
- Generic Writer: (setf lock) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf lock) ((user
user
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
lock
.
- Writer Method: (setf lock) ((channel
channel
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
lock
.
- Writer Method: (setf lock) ((connection
connection
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
lock
.
- Writer Method: (setf lock) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
lock
.
- Generic Function: open-connection (server) ¶
-
Start accepting incoming connections on the server.
This will launch a background thread which will call
HANDLE-PINGS on the server. It will also construct
and start the Hunchentoot acceptor of the server.
See HANDLE-PINGS
See THREAD
See ACCEPTOR
See SERVER
- Package
lichat-ws-server
.
- Methods
- Method: open-connection ((server
server
)) ¶
-
- Source
server.lisp
.
- Generic Reader: ping-interval (object) ¶
-
Accessor to the amount of seconds to wait for an update before sending a PING.
See SERVER
- Package
lichat-ws-server
.
- Methods
- Reader Method: ping-interval ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
ping-interval
.
- Generic Writer: (setf ping-interval) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf ping-interval) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
ping-interval
.
- Generic Reader: port (object) ¶
-
Accessor to the port of the object.
See SERVER
See *DEFAULT-PORT*
- Package
lichat-ws-server
.
- Methods
- Reader Method: port ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
port
.
- Generic Writer: (setf port) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf port) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
port
.
- Generic Reader: status (object) ¶
-
Accessor to the status of the connection.
The value should be one of :STARTING :RUNNING :STOPPING
See CONNECTION
- Package
lichat-ws-server
.
- Methods
- Reader Method: status ((connection
connection
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
status
.
- Generic Writer: (setf status) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf status) ((connection
connection
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
status
.
- Generic Reader: thread (object) ¶
-
Accessor to the background ping thread of the server.
See SERVER
- Package
lichat-ws-server
.
- Methods
- Reader Method: thread ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
thread
.
- Generic Writer: (setf thread) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf thread) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
thread
.
5.1.3 Standalone methods
- Method: check-message ((resource
websocket-resource
) (connection connection
) opcode length total) ¶
-
- Package
hunchensocket
.
- Source
server.lisp
.
- Method: client-connected ((server
server
) (connection connection
)) ¶
-
- Package
hunchensocket
.
- Source
server.lisp
.
- Method: client-disconnected ((server
server
) (connection connection
)) ¶
-
- Package
hunchensocket
.
- Source
server.lisp
.
- Method: init-connection :around ((connection
connection
) update) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: make-channel ((server
server
) &rest initargs) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: make-connection ((server
server
) &rest initargs) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: make-user ((server
server
) &rest initargs) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: process :around ((connection
connection
) (update create
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: process :around ((connection
connection
) (update register
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: send :around ((object
object
) (channel channel
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: send ((object
object
) (connection connection
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: teardown-connection :around ((connection
connection
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: teardown-connection :after ((connection
connection
)) ¶
-
- Package
lichat-serverlib
.
- Source
server.lisp
.
- Method: text-message-received ((server
server
) (connection connection
) message) ¶
-
- Package
hunchensocket
.
- Source
server.lisp
.
5.1.4 Classes
- Class: channel ¶
-
Channel class.
Access to the channel is properly handled for
mutual exclusion from threads by its LOCK. Particularly,
the following methods are mutually excluded via this lock:
LICHAT-SERVERLIB:JOIN
LICHAT-SERVERLIB:LEAVE
See LICHAT-SERVERLIB:CHANNEL
See LOCK
- Package
lichat-ws-server
.
- Source
server.lisp
.
- Direct superclasses
backlogged-channel
.
- Direct methods
-
- Direct slots
- Slot: lock ¶
-
- Initform
(bordeaux-threads:make-recursive-lock)
- Readers
lock
.
- Writers
(setf lock)
.
- Class: connection ¶
-
Connection class. Each connection to a client will have an instance of this class.
Access to the connection is properly handled for
mutual exclusion from threads by its LOCK. Particularly,
the following methods are mutually excluded via this lock:
LICHAT-SERVERLIB:SEND
See LICHAT-SERVERLIB:FLOOD-PROTECTED-CONNECTION
See HUNCHENSOCKET:WEBSOCKET-CLIENT
See STATUS
See LOCK
- Package
lichat-ws-server
.
- Source
server.lisp
.
- Direct superclasses
flood-protected-connection
.
websocket-client
.
- Direct methods
-
- Direct Default Initargs
-
- Direct slots
- Slot: lock ¶
-
- Initform
(bordeaux-threads:make-recursive-lock)
- Readers
lock
.
- Writers
(setf lock)
.
- Slot: status ¶
-
- Initform
:starting
- Readers
status
.
- Writers
(setf status)
.
- Class: server ¶
-
Server class. You should instantiate this.
Access to the server is properly handled for
mutual exclusion from threads by its LOCK. Particularly,
the following updates and processing methods for updates
are mutually excluded via this lock:
LICHAT-SERVERLIB:TEARDOWN-CONNECTION
LICHAT-PROTOCOL:CONNECT
LICHAT-PROTOCOL:REGISTER
LICHAT-PROTOCOL:CREATE
See LICHAT-SERVERLIB:FLOOD-PROTECTED-SERVER
See HUNCHENSOCKET:WEBSOCKET-RESOURCE
See HOSTNAME
See PORT
See ACCEPTOR
See THREAD
See PING-INTERVAL
See LOCK
See CONNECTIONS
- Package
lichat-ws-server
.
- Source
server.lisp
.
- Direct superclasses
flood-protected-server
.
websocket-resource
.
- Direct methods
-
- Direct Default Initargs
Initarg | Value |
:name | (machine-instance) |
:hostname | localhost |
:port | *default-port* |
:ping-interval | 10 |
:connection-limit | 100 |
:client-class | (quote connection) |
- Direct slots
- Slot: hostname ¶
-
- Initargs
:hostname
- Readers
hostname
.
- Writers
(setf hostname)
.
- Slot: port ¶
-
- Initargs
:port
- Readers
port
.
- Writers
(setf port)
.
- Slot: acceptor ¶
-
- Readers
acceptor
.
- Writers
(setf acceptor)
.
- Slot: thread ¶
-
- Readers
thread
.
- Writers
(setf thread)
.
- Slot: ping-interval ¶
-
- Initargs
:ping-interval
- Readers
ping-interval
.
- Writers
(setf ping-interval)
.
- Slot: lock ¶
-
- Initform
(bordeaux-threads:make-recursive-lock)
- Readers
lock
.
- Writers
(setf lock)
.
- Slot: connections ¶
-
- Readers
connections
.
- Writers
(setf connections)
.
- Slot: connection-limit ¶
-
- Initargs
:connection-limit
- Readers
connection-limit
.
- Writers
(setf connection-limit)
.
- Class: user ¶
-
User class.
Access to the user is properly handled for
mutual exclusion from threads by its LOCK. Particularly,
the following methods are mutually excluded via this lock:
LICHAT-SERVERLIB:JOIN
LICHAT-SERVERLIB:LEAVE
See LICHAT-SERVERLIB:USER
See LOCK
- Package
lichat-ws-server
.
- Source
server.lisp
.
- Direct superclasses
user
.
- Direct methods
-
- Direct slots
- Slot: lock ¶
-
- Initform
(bordeaux-threads:make-recursive-lock)
- Readers
lock
.
- Writers
(setf lock)
.
5.2 Internals
5.2.3 Generic functions
- Generic Reader: acceptor (object) ¶
-
Accessor to the Hunchentoot acceptor of the server.
See SERVER
- Package
lichat-ws-server
.
- Methods
- Reader Method: acceptor ((server
server
)) ¶
-
automatically generated reader method
- Source
server.lisp
.
- Target Slot
acceptor
.
- Generic Writer: (setf acceptor) (object) ¶
-
- Package
lichat-ws-server
.
- Methods
- Writer Method: (setf acceptor) ((server
server
)) ¶
-
automatically generated writer method
- Source
server.lisp
.
- Target Slot
acceptor
.
Appendix A Indexes
A.2 Functions
| |
|
( | | |
| (setf acceptor) : | | Private generic functions |
| (setf acceptor) : | | Private generic functions |
| (setf connection-limit) : | | Public generic functions |
| (setf connection-limit) : | | Public generic functions |
| (setf connections) : | | Public generic functions |
| (setf connections) : | | Public generic functions |
| (setf hostname) : | | Public generic functions |
| (setf hostname) : | | Public generic functions |
| (setf lock) : | | Public generic functions |
| (setf lock) : | | Public generic functions |
| (setf lock) : | | Public generic functions |
| (setf lock) : | | Public generic functions |
| (setf lock) : | | Public generic functions |
| (setf ping-interval) : | | Public generic functions |
| (setf ping-interval) : | | Public generic functions |
| (setf port) : | | Public generic functions |
| (setf port) : | | Public generic functions |
| (setf status) : | | Public generic functions |
| (setf status) : | | Public generic functions |
| (setf thread) : | | Public generic functions |
| (setf thread) : | | Public generic functions |
|
A | | |
| acceptor : | | Private generic functions |
| acceptor : | | Private generic functions |
|
C | | |
| check-message : | | Public standalone methods |
| client-connected : | | Public standalone methods |
| client-disconnected : | | Public standalone methods |
| close-connection : | | Public generic functions |
| close-connection : | | Public generic functions |
| connection-limit : | | Public generic functions |
| connection-limit : | | Public generic functions |
| connections : | | Public generic functions |
| connections : | | Public generic functions |
|
D | | |
| dispatch-server : | | Private ordinary functions |
|
F | | |
| Function, dispatch-server : | | Private ordinary functions |
|
G | | |
| Generic Function, (setf acceptor) : | | Private generic functions |
| Generic Function, (setf connection-limit) : | | Public generic functions |
| Generic Function, (setf connections) : | | Public generic functions |
| Generic Function, (setf hostname) : | | Public generic functions |
| Generic Function, (setf lock) : | | Public generic functions |
| Generic Function, (setf ping-interval) : | | Public generic functions |
| Generic Function, (setf port) : | | Public generic functions |
| Generic Function, (setf status) : | | Public generic functions |
| Generic Function, (setf thread) : | | Public generic functions |
| Generic Function, acceptor : | | Private generic functions |
| Generic Function, close-connection : | | Public generic functions |
| Generic Function, connection-limit : | | Public generic functions |
| Generic Function, connections : | | Public generic functions |
| Generic Function, handle-pings : | | Public generic functions |
| Generic Function, hostname : | | Public generic functions |
| Generic Function, lock : | | Public generic functions |
| Generic Function, open-connection : | | Public generic functions |
| Generic Function, ping-interval : | | Public generic functions |
| Generic Function, port : | | Public generic functions |
| Generic Function, status : | | Public generic functions |
| Generic Function, thread : | | Public generic functions |
|
H | | |
| handle-pings : | | Public generic functions |
| handle-pings : | | Public generic functions |
| hostname : | | Public generic functions |
| hostname : | | Public generic functions |
|
I | | |
| init-connection : | | Public standalone methods |
|
L | | |
| lock : | | Public generic functions |
| lock : | | Public generic functions |
| lock : | | Public generic functions |
| lock : | | Public generic functions |
| lock : | | Public generic functions |
|
M | | |
| make-channel : | | Public standalone methods |
| make-connection : | | Public standalone methods |
| make-user : | | Public standalone methods |
| Method, (setf acceptor) : | | Private generic functions |
| Method, (setf connection-limit) : | | Public generic functions |
| Method, (setf connections) : | | Public generic functions |
| Method, (setf hostname) : | | Public generic functions |
| Method, (setf lock) : | | Public generic functions |
| Method, (setf lock) : | | Public generic functions |
| Method, (setf lock) : | | Public generic functions |
| Method, (setf lock) : | | Public generic functions |
| Method, (setf ping-interval) : | | Public generic functions |
| Method, (setf port) : | | Public generic functions |
| Method, (setf status) : | | Public generic functions |
| Method, (setf thread) : | | Public generic functions |
| Method, acceptor : | | Private generic functions |
| Method, check-message : | | Public standalone methods |
| Method, client-connected : | | Public standalone methods |
| Method, client-disconnected : | | Public standalone methods |
| Method, close-connection : | | Public generic functions |
| Method, connection-limit : | | Public generic functions |
| Method, connections : | | Public generic functions |
| Method, handle-pings : | | Public generic functions |
| Method, hostname : | | Public generic functions |
| Method, init-connection : | | Public standalone methods |
| Method, lock : | | Public generic functions |
| Method, lock : | | Public generic functions |
| Method, lock : | | Public generic functions |
| Method, lock : | | Public generic functions |
| Method, make-channel : | | Public standalone methods |
| Method, make-connection : | | Public standalone methods |
| Method, make-user : | | Public standalone methods |
| Method, open-connection : | | Public generic functions |
| Method, ping-interval : | | Public generic functions |
| Method, port : | | Public generic functions |
| Method, process : | | Public standalone methods |
| Method, process : | | Public standalone methods |
| Method, send : | | Public standalone methods |
| Method, send : | | Public standalone methods |
| Method, status : | | Public generic functions |
| Method, teardown-connection : | | Public standalone methods |
| Method, teardown-connection : | | Public standalone methods |
| Method, text-message-received : | | Public standalone methods |
| Method, thread : | | Public generic functions |
|
O | | |
| open-connection : | | Public generic functions |
| open-connection : | | Public generic functions |
|
P | | |
| ping-interval : | | Public generic functions |
| ping-interval : | | Public generic functions |
| port : | | Public generic functions |
| port : | | Public generic functions |
| process : | | Public standalone methods |
| process : | | Public standalone methods |
|
S | | |
| send : | | Public standalone methods |
| send : | | Public standalone methods |
| status : | | Public generic functions |
| status : | | Public generic functions |
|
T | | |
| teardown-connection : | | Public standalone methods |
| teardown-connection : | | Public standalone methods |
| text-message-received : | | Public standalone methods |
| thread : | | Public generic functions |
| thread : | | Public generic functions |
|
A.3 Variables
| |
|
* | | |
| *default-port* : | | Public special variables |
| *servers* : | | Private special variables |
|
A | | |
| acceptor : | | Public classes |
|
C | | |
| connection-limit : | | Public classes |
| connections : | | Public classes |
|
H | | |
| hostname : | | Public classes |
|
L | | |
| lock : | | Public classes |
| lock : | | Public classes |
| lock : | | Public classes |
| lock : | | Public classes |
|
P | | |
| ping-interval : | | Public classes |
| port : | | Public classes |
|
S | | |
| Slot, acceptor : | | Public classes |
| Slot, connection-limit : | | Public classes |
| Slot, connections : | | Public classes |
| Slot, hostname : | | Public classes |
| Slot, lock : | | Public classes |
| Slot, lock : | | Public classes |
| Slot, lock : | | Public classes |
| Slot, lock : | | Public classes |
| Slot, ping-interval : | | Public classes |
| Slot, port : | | Public classes |
| Slot, status : | | Public classes |
| Slot, thread : | | Public classes |
| Special Variable, *default-port* : | | Public special variables |
| Special Variable, *servers* : | | Private special variables |
| status : | | Public classes |
|
T | | |
| thread : | | Public classes |
|
A.4 Data types
| |
|
C | | |
| channel : | | Public classes |
| Class, channel : | | Public classes |
| Class, connection : | | Public classes |
| Class, server : | | Public classes |
| Class, user : | | Public classes |
| connection : | | Public classes |
|
D | | |
| documentation.lisp : | | The lichat-ws-server/documentation․lisp file |
|
F | | |
| File, documentation.lisp : | | The lichat-ws-server/documentation․lisp file |
| File, lichat-ws-server.asd : | | The lichat-ws-server/lichat-ws-server․asd file |
| File, package.lisp : | | The lichat-ws-server/package․lisp file |
| File, server.lisp : | | The lichat-ws-server/server․lisp file |
|
L | | |
| lichat-ws-server : | | The lichat-ws-server system |
| lichat-ws-server : | | The lichat-ws-server package |
| lichat-ws-server.asd : | | The lichat-ws-server/lichat-ws-server․asd file |
|
P | | |
| Package, lichat-ws-server : | | The lichat-ws-server package |
| package.lisp : | | The lichat-ws-server/package․lisp file |
|
S | | |
| server : | | Public classes |
| server.lisp : | | The lichat-ws-server/server․lisp file |
| System, lichat-ws-server : | | The lichat-ws-server system |
|
U | | |
| user : | | Public classes |
|