The portal Reference Manual

This is the portal Reference Manual, version 1.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:19:25 2024 GMT+0.

Table of Contents


1 Systems

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


1.1 portal

Portable websockets.

Author

Charles Jackson <>

License

LLGPL

Version

1.2

Dependencies
  • usocket-server (system).
  • alexandria (system).
  • arrows (system).
  • global-vars (system).
  • str (system).
  • ironclad (system).
  • cl-base64 (system).
  • flexi-streams (system).
  • parse-float (system).
Source

portal.asd.

Child Components

2 Files

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


2.1 Lisp


2.1.1 portal/portal.asd

Source

portal.asd.

Parent Component

portal (system).

ASDF Systems

portal.


2.1.2 portal/package.lisp

Source

portal.asd.

Parent Component

portal (system).

Packages

portal.


2.1.3 portal/portal.lisp

Dependency

package.lisp (file).

Source

portal.asd.

Parent Component

portal (system).

Public Interface
Internals

3 Packages

Packages are listed by definition order.


3.1 portal

Source

package.lisp.

Nickname

pws

Use List

common-lisp.

Public Interface
Internals

4 Definitions

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


4.1 Public Interface


4.1.1 Special variables

Special Variable: *debug-on-error*
Package

portal.

Source

portal.lisp.


4.1.2 Ordinary functions

Function: define-resource (path &key open message close error)
Package

portal.

Source

portal.lisp.

Function: server (&optional port multi-thread)
Package

portal.

Source

portal.lisp.

Function: server-close (websocket-server)
Package

portal.

Source

portal.lisp.


4.1.3 Generic functions

Generic Function: close (websocket &rest abort)
Package

portal.

Methods
Method: close ((websocket websocket) &rest abort)
Source

portal.lisp.

Generic Reader: header (object)
Package

portal.

Methods
Reader Method: header ((websocket websocket))

HTTP header for websocket upgrade.

Source

portal.lisp.

Target Slot

header.

Generic Reader: ready-state (object)
Package

portal.

Methods
Reader Method: ready-state ((websocket websocket))

automatically generated reader method

Source

portal.lisp.

Target Slot

ready-state.

Generic Function: send (websocket message)
Package

portal.

Methods
Method: send ((websocket websocket) message)
Source

portal.lisp.

Generic Function: send-ping (websocket message)
Package

portal.

Methods
Method: send-ping ((websocket websocket) message)
Source

portal.lisp.


4.1.4 Classes

Class: websocket
Package

portal.

Source

portal.lisp.

Direct methods
Direct slots
Slot: header

HTTP header for websocket upgrade.

Type

list

Initargs

:header

Readers

header.

Writers

This slot is read-only.

Slot: stream
Package

common-lisp.

Type

stream

Initargs

:stream

Readers

socket-stream.

Writers

(setf socket-stream).

Slot: ready-state
Type

number

Initform

0

Readers

ready-state.

Writers

This slot is read-only.

Slot: fragment-opcode

Store the type of frame we are currently on.

Readers

opcode.

Writers

This slot is read-only.

Slot: stash

Store the message content before all fames have arrived.

Type

list

Initform

(list)

Readers

stash.

Writers

This slot is read-only.


4.2 Internals


4.2.1 Constants

Constant: +binary+
Package

portal.

Source

portal.lisp.

Constant: +close+
Package

portal.

Source

portal.lisp.

Constant: +closed+
Package

portal.

Source

portal.lisp.

Constant: +closing+

When the first closing frame has been sent or received.

Package

portal.

Source

portal.lisp.

Constant: +connecting+
Package

portal.

Source

portal.lisp.

Constant: +continuation+
Package

portal.

Source

portal.lisp.

Constant: +crlf+
Package

portal.

Source

portal.lisp.

Constant: +http-version+
Package

portal.

Source

portal.lisp.

Constant: +ping+
Package

portal.

Source

portal.lisp.

Constant: +pong+
Package

portal.

Source

portal.lisp.

Constant: +ready+
Package

portal.

Source

portal.lisp.

Constant: +sec-key+
Package

portal.

Source

portal.lisp.

Constant: +text+
Package

portal.

Source

portal.lisp.


4.2.2 Ordinary functions

Function: alist->header (alist)

Return the string response header corresponding to ALIST.

Package

portal.

Source

portal.lisp.

Function: call-resource-function (function-name websocket &rest arguments)
Package

portal.

Source

portal.lisp.

Function: can-upgrade-p (header)

True if the alist HEADER has qualified to be upgraded to a websocket. If nil, the second value will be the reason.

Package

portal.

Source

portal.lisp.

Function: header->alist (string)

Return the alist corresponding to the request header STRING.

Package

portal.

Source

portal.lisp.

Function: read-until (string &optional stream)
Package

portal.

Source

portal.lisp.

Function: sha1-base64 (string)
Package

portal.

Source

portal.lisp.

Function: starts-with (start list)
Package

portal.

Source

portal.lisp.

Function: websocket-handler (stream)
Package

portal.

Source

portal.lisp.


4.2.3 Generic functions

Generic Function: append-stash (websocket sequence)
Package

portal.

Methods
Method: append-stash ((websocket websocket) sequence)
Source

portal.lisp.

Generic Function: clear-stash (websocket)
Package

portal.

Methods
Method: clear-stash ((websocket websocket))
Source

portal.lisp.

Generic Function: get-stash (websocket)
Package

portal.

Methods
Method: get-stash ((websocket websocket))
Source

portal.lisp.

Generic Reader: opcode (object)
Package

portal.

Methods
Reader Method: opcode ((websocket websocket))

Store the type of frame we are currently on.

Source

portal.lisp.

Target Slot

fragment-opcode.

Generic Function: read-frame (websocket)
Package

portal.

Methods
Method: read-frame ((websocket websocket))

Read a from from the stream of WEBSOCKET.
when the frame is the last one in a series, return the complete message. Could also return :eof, :close, :error.

Source

portal.lisp.

Generic Function: send-close-frame (websocket)
Package

portal.

Methods
Method: send-close-frame ((websocket websocket))
Source

portal.lisp.

Generic Function: send-pong (websocket message)
Package

portal.

Methods
Method: send-pong ((websocket websocket) message)
Source

portal.lisp.

Generic Reader: socket-stream (object)
Package

portal.

Methods
Reader Method: socket-stream ((websocket websocket))

automatically generated reader method

Source

portal.lisp.

Target Slot

stream.

Generic Writer: (setf socket-stream) (object)
Package

portal.

Methods
Writer Method: (setf socket-stream) ((websocket websocket))

automatically generated writer method

Source

portal.lisp.

Target Slot

stream.

Generic Reader: stash (object)
Package

portal.

Methods
Reader Method: stash ((websocket websocket))

Store the message content before all fames have arrived.

Source

portal.lisp.

Target Slot

stash.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   F   G   H   M   O   R   S   W  
Index Entry  Section

(
(setf socket-stream): Private generic functions
(setf socket-stream): Private generic functions

A
alist->header: Private ordinary functions
append-stash: Private generic functions
append-stash: Private generic functions

C
call-resource-function: Private ordinary functions
can-upgrade-p: Private ordinary functions
clear-stash: Private generic functions
clear-stash: Private generic functions
close: Public generic functions
close: Public generic functions

D
define-resource: Public ordinary functions

F
Function, alist->header: Private ordinary functions
Function, call-resource-function: Private ordinary functions
Function, can-upgrade-p: Private ordinary functions
Function, define-resource: Public ordinary functions
Function, header->alist: Private ordinary functions
Function, read-until: Private ordinary functions
Function, server: Public ordinary functions
Function, server-close: Public ordinary functions
Function, sha1-base64: Private ordinary functions
Function, starts-with: Private ordinary functions
Function, websocket-handler: Private ordinary functions

G
Generic Function, (setf socket-stream): Private generic functions
Generic Function, append-stash: Private generic functions
Generic Function, clear-stash: Private generic functions
Generic Function, close: Public generic functions
Generic Function, get-stash: Private generic functions
Generic Function, header: Public generic functions
Generic Function, opcode: Private generic functions
Generic Function, read-frame: Private generic functions
Generic Function, ready-state: Public generic functions
Generic Function, send: Public generic functions
Generic Function, send-close-frame: Private generic functions
Generic Function, send-ping: Public generic functions
Generic Function, send-pong: Private generic functions
Generic Function, socket-stream: Private generic functions
Generic Function, stash: Private generic functions
get-stash: Private generic functions
get-stash: Private generic functions

H
header: Public generic functions
header: Public generic functions
header->alist: Private ordinary functions

M
Method, (setf socket-stream): Private generic functions
Method, append-stash: Private generic functions
Method, clear-stash: Private generic functions
Method, close: Public generic functions
Method, get-stash: Private generic functions
Method, header: Public generic functions
Method, opcode: Private generic functions
Method, read-frame: Private generic functions
Method, ready-state: Public generic functions
Method, send: Public generic functions
Method, send-close-frame: Private generic functions
Method, send-ping: Public generic functions
Method, send-pong: Private generic functions
Method, socket-stream: Private generic functions
Method, stash: Private generic functions

O
opcode: Private generic functions
opcode: Private generic functions

R
read-frame: Private generic functions
read-frame: Private generic functions
read-until: Private ordinary functions
ready-state: Public generic functions
ready-state: Public generic functions

S
send: Public generic functions
send: Public generic functions
send-close-frame: Private generic functions
send-close-frame: Private generic functions
send-ping: Public generic functions
send-ping: Public generic functions
send-pong: Private generic functions
send-pong: Private generic functions
server: Public ordinary functions
server-close: Public ordinary functions
sha1-base64: Private ordinary functions
socket-stream: Private generic functions
socket-stream: Private generic functions
starts-with: Private ordinary functions
stash: Private generic functions
stash: Private generic functions

W
websocket-handler: Private ordinary functions


A.3 Variables