Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the lichat-tcp-server Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 14:00:07 2020 GMT+0.
• Introduction | What lichat-tcp-server is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
This is a simple, threaded, TCP-based server for the Lichat protocol.
Create a new server instance and pass it whatever settings you would like.
(defvar *server* (make-instance 'lichat-tcp-server:server))
Notable initargs of potential interest are:
:name
The name the server goes by on its own network. Defaults to (machine-instance)
.:hostname
The hostname to which the TCP listener should bind. The default is 0.0.0.0
.:port
The port the TCP listener should listen on. The default is 1111
.:ping-interval
The interval in which pings should be sent out to clients. The default is 60
.:salt
The salt with which passwords are hashed. The default is an empty string.:idle-timeout
The number of seconds without a response from a client after which it is considered to have timed out. The default is 120
.:flood-frame
The size of a flood prevention frame. The default is 30
.:flood-limit
The number of allowed updates within a frame before flood limitation takes effect. The default is 40
.:connection-limit
The number of connections in total that the server supports before dropping incoming ones. The default is 100
.Once a server exists, it can be started to listen to incoming connections:
(lichat-tcp-server:open-connection *server*)
The server logs information via Verbose. If you set the REPL level to :trace
you should see a bunch of status messages being printed every now and again.
Once you're done with the server, you can shut it down again.
(lichat-tcp-server:close-connection *server*)
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The lichat-tcp-server system |
Nicolas Hafner <shinmera@tymoon.eu>
Nicolas Hafner <shinmera@tymoon.eu>
(:git "https://github.com/shirakumo/lichat-tcp-server.git")
zlib
A simple TCP server implementation for lichat.
1.0.0
lichat-tcp-server.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The lichat-tcp-server.asd file | ||
• The lichat-tcp-server/package.lisp file | ||
• The lichat-tcp-server/server.lisp file | ||
• The lichat-tcp-server/documentation.lisp file |
Next: The lichat-tcp-server/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
lichat-tcp-server.asd
lichat-tcp-server (system)
Next: The lichat-tcp-server/server․lisp file, Previous: The lichat-tcp-server․asd file, Up: Lisp files [Contents][Index]
lichat-tcp-server (system)
package.lisp
Next: The lichat-tcp-server/documentation․lisp file, Previous: The lichat-tcp-server/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
lichat-tcp-server (system)
server.lisp
Previous: The lichat-tcp-server/server․lisp file, Up: Lisp files [Contents][Index]
server.lisp (file)
lichat-tcp-server (system)
documentation.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The lichat-tcp-server package |
package.lisp (file)
org.shirakumo.lichat.tcp-server
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported classes |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
The standard port on which the server will run.
Should be 1111.
server.lisp (file)
Next: Exported generic functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Ensures that the host-ish is turned into a hostname string.
server.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Stop accepting incoming connections and close all existing ones.
Can be used with either a SERVER or a CONNECTION.
See CONNECTIONS
See THREAD
See SERVER
See CONNECTION
server.lisp (file)
server.lisp (file)
automatically generated reader method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Accessor to the list of connections on the server.
See SERVER
See CONNECTION
(setf connections) (generic function)
automatically generated reader method
server.lisp (file)
connections (generic function)
automatically generated writer method
server.lisp (file)
Responsible for establishing a new connection to a client.
This will construct and push a new CONNECTION object onto the server using the given socket. It will also launch the CONNECTION’s background handling thread.
server.lisp (file)
Handle the socket with the given object.
The object should be either a SERVER or a CONNECTION.
In the case of the server, it will listen for new clients
and if one is found, call ESTABLISH-CONNECTION.
In the case of the client, it will first manage connection
establishment as per the Lichat protocol, then repeatedly
wait for a new update with a timeout. If the timeout is
reached, a PING update is sent to the connection. If an
update is received, it is PROCESSED. If the socket ever
experiences a connection problem (timeout, shutdown, reset,
etc) then the connection is immediately closed.
Provides a CLOSE-CONNECTION restart as mandated by the
serverlib.
See SERVER
See CONNECTION
See ESTABLISH-CONNECTION
See LICHAT-SERVERLIB:PROCESS
server.lisp (file)
server.lisp (file)
server.lisp (file)
Accessor to the hostname of the connection.
See CONNECTION
(setf hostname) (generic function)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
hostname (generic function)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Accessor to the lock of the object that is used to mutually exclude access.
See SERVER
See CONNECTION
See USER
See CHANNEL
(setf lock) (generic function)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
lock (generic function)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Start accepting incoming connections on the server.
This will launch a background thread which will call HANDLE-CONNECTION on the socket and server.
See HANDLE-CONNECTION
See THREAD
See SERVER
server.lisp (file)
Accessor to the amount of seconds to wait for an update before sending a PING.
See SERVER
(setf ping-interval) (generic function)
automatically generated reader method
server.lisp (file)
ping-interval (generic function)
automatically generated writer method
server.lisp (file)
Accessor to the port of the connection.
See CONNECTION
(setf port) (generic function)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
port (generic function)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Accessor to the TCP socket of the connection.
See USOCKET:SOCKET
See CONNECTION
(setf socket) (generic function)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
socket (generic function)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Accessor to the background processing thread of the object.
See SERVER
See CONNECTION
(setf thread) (generic function)
automatically generated reader method
server.lisp (file)
automatically generated reader method
server.lisp (file)
thread (generic function)
automatically generated writer method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
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
server.lisp (file)
backlogged-channel (class)
(bordeaux-threads:make-recursive-lock)
lock (generic function)
(setf lock) (generic function)
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 SOCKET
See THREAD
See LOCK
server.lisp (file)
flood-protected-connection (class)
:hostname
hostname (generic function)
(setf hostname) (generic function)
:port
port (generic function)
(setf port) (generic function)
:socket
socket (generic function)
(setf socket) (generic function)
:thread
thread (generic function)
(setf thread) (generic function)
(make-array 0 :adjustable t :fill-pointer t)
queue (generic function)
(setf queue) (generic function)
(make-array 0 :adjustable t :fill-pointer t)
back-queue (generic function)
(setf back-queue) (generic function)
(bordeaux-threads:make-recursive-lock)
lock (generic function)
(setf lock) (generic function)
Initarg | Value |
---|---|
:socket | (error "socket required.") |
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 HOSTNAME
See PORT
See THREAD
See PING-INTERVAL
See LOCK
See CONNECTIONS
server.lisp (file)
flood-protected-server (class)
:hostname
hostname (generic function)
(setf hostname) (generic function)
:port
port (generic function)
(setf port) (generic function)
socket (generic function)
(setf socket) (generic function)
:thread
thread (generic function)
(setf thread) (generic function)
:ping-interval
ping-interval (generic function)
(setf ping-interval) (generic function)
(bordeaux-threads:make-recursive-lock)
lock (generic function)
(setf lock) (generic function)
connections (generic function)
(setf connections) (generic function)
:connection-limit
connection-limit (generic function)
(setf connection-limit) (generic function)
Initarg | Value |
---|---|
:name | (machine-instance) |
:hostname | "localhost" |
:port | lichat-tcp-server:*default-port* |
:thread | nil |
:ping-interval | 10 |
:connection-limit | 100 |
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
server.lisp (file)
user (class)
(bordeaux-threads:make-recursive-lock)
lock (generic function)
(setf lock) (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal generic functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
automatically generated reader method
server.lisp (file)
automatically generated writer method
server.lisp (file)
automatically generated reader method
server.lisp (file)
automatically generated writer method
server.lisp (file)
server.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L |
---|
Jump to: | F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
B C E F G H L M O P Q S T |
---|
Jump to: | (
B C E F G H L M O P Q S T |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
B C H L P Q S T |
---|
Jump to: | *
B C H L P Q S T |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C L P S U |
---|
Jump to: | C L P S U |
---|