The lichat-ws-server Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The lichat-ws-server Reference Manual

This is the lichat-ws-server Reference Manual, version 1.0.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:05:24 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Lichat-WS-Server

This is a simple, threaded, WebSocket-based server for the Lichat protocol.

How To

Create a new server instance and pass it whatever settings you would like.

(defvar *server* (make-instance 'lichat-ws-server:server))

Notable initargs of potential interest are:

Once a server exists, it can be started to listen to incoming connections:

(lichat-ws-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-ws-server:close-connection *server*)

Also See


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 lichat-ws-server

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shirakumo/lichat-ws-server

License

Artistic

Description

A simple WebSocket server implementation for lichat.

Version

1.0.0

Dependencies
Source

lichat-ws-server.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 lichat-ws-server.asd

Location

lichat-ws-server.asd

Systems

lichat-ws-server (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 lichat-ws-server/package.lisp

Parent

lichat-ws-server (system)

Location

package.lisp

Packages

lichat-ws-server


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 lichat-ws-server/server.lisp

Dependency

package.lisp (file)

Parent

lichat-ws-server (system)

Location

server.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 lichat-ws-server/documentation.lisp

Dependency

server.lisp (file)

Parent

lichat-ws-server (system)

Location

documentation.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 lichat-ws-server

Source

package.lisp (file)

Nickname

org.shirakumo.lichat.ws-server

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

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 (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

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 (file)

Generic Function: connection-limit OBJECT
Generic Function: (setf connection-limit) NEW-VALUE OBJECT
Package

lichat-ws-server

Methods
Method: connection-limit (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Method: (setf connection-limit) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

Generic Function: connections OBJECT

Accessor to the list of connections on the server.

See SERVER
See CONNECTION

Package

lichat-ws-server

Writer

(setf connections) (generic function)

Methods
Method: connections (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf connections) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

connections (generic function)

Methods
Method: (setf connections) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

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 (file)

Generic Function: hostname OBJECT

Accessor to the hostname of the object.

See SERVER

Package

lichat-ws-server

Writer

(setf hostname) (generic function)

Methods
Method: hostname (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf hostname) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

hostname (generic function)

Methods
Method: (setf hostname) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

Generic Function: 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

Writer

(setf lock) (generic function)

Methods
Method: lock (USER user)

automatically generated reader method

Source

server.lisp (file)

Method: lock (CHANNEL channel)

automatically generated reader method

Source

server.lisp (file)

Method: lock (CONNECTION connection)

automatically generated reader method

Source

server.lisp (file)

Method: lock (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf lock) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

lock (generic function)

Methods
Method: (setf lock) NEW-VALUE (USER user)

automatically generated writer method

Source

server.lisp (file)

Method: (setf lock) NEW-VALUE (CHANNEL channel)

automatically generated writer method

Source

server.lisp (file)

Method: (setf lock) NEW-VALUE (CONNECTION connection)

automatically generated writer method

Source

server.lisp (file)

Method: (setf lock) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

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 (file)

Generic Function: ping-interval OBJECT

Accessor to the amount of seconds to wait for an update before sending a PING.

See SERVER

Package

lichat-ws-server

Writer

(setf ping-interval) (generic function)

Methods
Method: ping-interval (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf ping-interval) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

ping-interval (generic function)

Methods
Method: (setf ping-interval) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

Generic Function: port OBJECT

Accessor to the port of the object.

See SERVER
See *DEFAULT-PORT*

Package

lichat-ws-server

Writer

(setf port) (generic function)

Methods
Method: port (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf port) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

port (generic function)

Methods
Method: (setf port) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)

Generic Function: status OBJECT

Accessor to the status of the connection.

The value should be one of :STARTING :RUNNING :STOPPING

See CONNECTION

Package

lichat-ws-server

Writer

(setf status) (generic function)

Methods
Method: status (CONNECTION connection)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf status) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

status (generic function)

Methods
Method: (setf status) NEW-VALUE (CONNECTION connection)

automatically generated writer method

Source

server.lisp (file)

Generic Function: thread OBJECT

Accessor to the background ping thread of the server.

See SERVER

Package

lichat-ws-server

Writer

(setf thread) (generic function)

Methods
Method: thread (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf thread) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

thread (generic function)

Methods
Method: (setf thread) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 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 (file)

Direct superclasses

backlogged-channel (class)

Direct methods
  • send (method)
  • lock (method)
  • lock (method)
Direct slots
Slot: lock
Initform

(bordeaux-threads:make-recursive-lock)

Readers

lock (generic function)

Writers

(setf lock) (generic function)

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 (file)

Direct superclasses
  • websocket-client (class)
  • flood-protected-connection (class)
Direct methods
  • process (method)
  • process (method)
  • teardown-connection (method)
  • init-connection (method)
  • teardown-connection (method)
  • send (method)
  • check-message (method)
  • text-message-received (method)
  • client-disconnected (method)
  • client-connected (method)
  • status (method)
  • status (method)
  • lock (method)
  • lock (method)
Direct slots
Slot: lock
Initform

(bordeaux-threads:make-recursive-lock)

Readers

lock (generic function)

Writers

(setf lock) (generic function)

Slot: status
Initform

:starting

Readers

status (generic function)

Writers

(setf status) (generic function)

Direct Default Initargs
InitargValue
:usernil
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 (file)

Direct superclasses
  • websocket-resource (class)
  • flood-protected-server (class)
Direct methods
Direct slots
Slot: hostname
Initargs

:hostname

Readers

hostname (generic function)

Writers

(setf hostname) (generic function)

Slot: port
Initargs

:port

Readers

port (generic function)

Writers

(setf port) (generic function)

Slot: acceptor
Readers

acceptor (generic function)

Writers

(setf acceptor) (generic function)

Slot: thread
Readers

thread (generic function)

Writers

(setf thread) (generic function)

Slot: ping-interval
Initargs

:ping-interval

Readers

ping-interval (generic function)

Writers

(setf ping-interval) (generic function)

Slot: lock
Initform

(bordeaux-threads:make-recursive-lock)

Readers

lock (generic function)

Writers

(setf lock) (generic function)

Slot: connections
Readers

connections (generic function)

Writers

(setf connections) (generic function)

Slot: connection-limit
Initargs

:connection-limit

Readers

connection-limit (generic function)

Writers

(setf connection-limit) (generic function)

Direct Default Initargs
InitargValue
:name(machine-instance)
:hostname"localhost"
:portlichat-ws-server:*default-port*
:ping-interval10
:connection-limit100
:client-class(quote lichat-ws-server:connection)
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 (file)

Direct superclasses

user (class)

Direct methods
  • lock (method)
  • lock (method)
Direct slots
Slot: lock
Initform

(bordeaux-threads:make-recursive-lock)

Readers

lock (generic function)

Writers

(setf lock) (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *servers*
Package

lichat-ws-server

Source

server.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: dispatch-server REQUEST
Package

lichat-ws-server

Source

server.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: acceptor OBJECT

Accessor to the Hunchentoot acceptor of the server.

See SERVER

Package

lichat-ws-server

Writer

(setf acceptor) (generic function)

Methods
Method: acceptor (SERVER server)

automatically generated reader method

Source

server.lisp (file)

Generic Function: (setf acceptor) NEW-VALUE OBJECT
Package

lichat-ws-server

Reader

acceptor (generic function)

Methods
Method: (setf acceptor) NEW-VALUE (SERVER server)

automatically generated writer method

Source

server.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, lichat-ws-server.asd: The lichat-ws-server<dot>asd file
File, Lisp, lichat-ws-server/documentation.lisp: The lichat-ws-server/documentation<dot>lisp file
File, Lisp, lichat-ws-server/package.lisp: The lichat-ws-server/package<dot>lisp file
File, Lisp, lichat-ws-server/server.lisp: The lichat-ws-server/server<dot>lisp file

L
lichat-ws-server.asd: The lichat-ws-server<dot>asd file
lichat-ws-server/documentation.lisp: The lichat-ws-server/documentation<dot>lisp file
lichat-ws-server/package.lisp: The lichat-ws-server/package<dot>lisp file
lichat-ws-server/server.lisp: The lichat-ws-server/server<dot>lisp file
Lisp File, lichat-ws-server.asd: The lichat-ws-server<dot>asd file
Lisp File, lichat-ws-server/documentation.lisp: The lichat-ws-server/documentation<dot>lisp file
Lisp File, lichat-ws-server/package.lisp: The lichat-ws-server/package<dot>lisp file
Lisp File, lichat-ws-server/server.lisp: The lichat-ws-server/server<dot>lisp file

Jump to:   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   H   L   M   O   P   S   T  
Index Entry  Section

(
(setf acceptor): Internal generic functions
(setf acceptor): Internal generic functions
(setf connection-limit): Exported generic functions
(setf connection-limit): Exported generic functions
(setf connections): Exported generic functions
(setf connections): Exported generic functions
(setf hostname): Exported generic functions
(setf hostname): Exported generic functions
(setf lock): Exported generic functions
(setf lock): Exported generic functions
(setf lock): Exported generic functions
(setf lock): Exported generic functions
(setf lock): Exported generic functions
(setf ping-interval): Exported generic functions
(setf ping-interval): Exported generic functions
(setf port): Exported generic functions
(setf port): Exported generic functions
(setf status): Exported generic functions
(setf status): Exported generic functions
(setf thread): Exported generic functions
(setf thread): Exported generic functions

A
acceptor: Internal generic functions
acceptor: Internal generic functions

C
close-connection: Exported generic functions
close-connection: Exported generic functions
connection-limit: Exported generic functions
connection-limit: Exported generic functions
connections: Exported generic functions
connections: Exported generic functions

D
dispatch-server: Internal functions

F
Function, dispatch-server: Internal functions

G
Generic Function, (setf acceptor): Internal generic functions
Generic Function, (setf connection-limit): Exported generic functions
Generic Function, (setf connections): Exported generic functions
Generic Function, (setf hostname): Exported generic functions
Generic Function, (setf lock): Exported generic functions
Generic Function, (setf ping-interval): Exported generic functions
Generic Function, (setf port): Exported generic functions
Generic Function, (setf status): Exported generic functions
Generic Function, (setf thread): Exported generic functions
Generic Function, acceptor: Internal generic functions
Generic Function, close-connection: Exported generic functions
Generic Function, connection-limit: Exported generic functions
Generic Function, connections: Exported generic functions
Generic Function, handle-pings: Exported generic functions
Generic Function, hostname: Exported generic functions
Generic Function, lock: Exported generic functions
Generic Function, open-connection: Exported generic functions
Generic Function, ping-interval: Exported generic functions
Generic Function, port: Exported generic functions
Generic Function, status: Exported generic functions
Generic Function, thread: Exported generic functions

H
handle-pings: Exported generic functions
handle-pings: Exported generic functions
hostname: Exported generic functions
hostname: Exported generic functions

L
lock: Exported generic functions
lock: Exported generic functions
lock: Exported generic functions
lock: Exported generic functions
lock: Exported generic functions

M
Method, (setf acceptor): Internal generic functions
Method, (setf connection-limit): Exported generic functions
Method, (setf connections): Exported generic functions
Method, (setf hostname): Exported generic functions
Method, (setf lock): Exported generic functions
Method, (setf lock): Exported generic functions
Method, (setf lock): Exported generic functions
Method, (setf lock): Exported generic functions
Method, (setf ping-interval): Exported generic functions
Method, (setf port): Exported generic functions
Method, (setf status): Exported generic functions
Method, (setf thread): Exported generic functions
Method, acceptor: Internal generic functions
Method, close-connection: Exported generic functions
Method, connection-limit: Exported generic functions
Method, connections: Exported generic functions
Method, handle-pings: Exported generic functions
Method, hostname: Exported generic functions
Method, lock: Exported generic functions
Method, lock: Exported generic functions
Method, lock: Exported generic functions
Method, lock: Exported generic functions
Method, open-connection: Exported generic functions
Method, ping-interval: Exported generic functions
Method, port: Exported generic functions
Method, status: Exported generic functions
Method, thread: Exported generic functions

O
open-connection: Exported generic functions
open-connection: Exported generic functions

P
ping-interval: Exported generic functions
ping-interval: Exported generic functions
port: Exported generic functions
port: Exported generic functions

S
status: Exported generic functions
status: Exported generic functions

T
thread: Exported generic functions
thread: Exported generic functions

Jump to:   (  
A   C   D   F   G   H   L   M   O   P   S   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
A   C   H   L   P   S   T  
Index Entry  Section

*
*default-port*: Exported special variables
*servers*: Internal special variables

A
acceptor: Exported classes

C
connection-limit: Exported classes
connections: Exported classes

H
hostname: Exported classes

L
lock: Exported classes
lock: Exported classes
lock: Exported classes
lock: Exported classes

P
ping-interval: Exported classes
port: Exported classes

S
Slot, acceptor: Exported classes
Slot, connection-limit: Exported classes
Slot, connections: Exported classes
Slot, hostname: Exported classes
Slot, lock: Exported classes
Slot, lock: Exported classes
Slot, lock: Exported classes
Slot, lock: Exported classes
Slot, ping-interval: Exported classes
Slot, port: Exported classes
Slot, status: Exported classes
Slot, thread: Exported classes
Special Variable, *default-port*: Exported special variables
Special Variable, *servers*: Internal special variables
status: Exported classes

T
thread: Exported classes

Jump to:   *  
A   C   H   L   P   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   L   P   S   U  
Index Entry  Section

C
channel: Exported classes
Class, channel: Exported classes
Class, connection: Exported classes
Class, server: Exported classes
Class, user: Exported classes
connection: Exported classes

L
lichat-ws-server: The lichat-ws-server system
lichat-ws-server: The lichat-ws-server package

P
Package, lichat-ws-server: The lichat-ws-server package

S
server: Exported classes
System, lichat-ws-server: The lichat-ws-server system

U
user: Exported classes

Jump to:   C   L   P   S   U