Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the clws Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 11:35:58 2018 GMT+0.
• Introduction: | What clws 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 |
Currently requires SBCL or CCL, but shouldn't be too hard to port to other implementations/platforms supported by iolib.
Supports WebSocket draft protocols 7,8, and 13, and optionally 0.
Doesn't currently support wss:
(TLS/SSL) connections, but proxying behind stud or stunnel should work.
First, set up a package:
(defpackage #:clws-echo
(:use :cl :clws))
(in-package #:clws-echo)
Then we can start the websockets server, here we use port 12345:
(bordeaux-threads:make-thread (lambda ()
(run-server 12345))
:name "websockets server")
Next we need to define a 'resource', which we will call /echo
(so we will connect with URIs like ws://localhost/echo
). To do that, we subclass ws-resource
and specialize a few generic functions on that class:
(defclass echo-resource (ws-resource)
())
(defmethod resource-client-connected ((res echo-resource) client)
(format t "got connection on echo server from ~s : ~s~%" (client-host client) (client-port client))
t)
(defmethod resource-client-disconnected ((resource echo-resource) client)
(format t "Client disconnected from resource ~A: ~A~%" resource client))
(defmethod resource-received-text ((res echo-resource) client message)
(format t "got frame ~s from client ~s" message client)
(write-to-client-text client message))
(defmethod resource-received-binary((res echo-resource) client message)
(format t "got binary frame ~s from client ~s" (length message) client)
(write-to-client-binary client message))
Finally, we register the resource with the server, and start a thread to handle messages for that resource:
(register-global-resource "/echo"
(make-instance 'echo-resource)
(origin-prefix "http://127.0.0.1" "http://localhost"))
(bordeaux-threads:make-thread (lambda ()
(run-resource-listener
(find-global-resource "/echo")))
:name "resource listener for /echo")
*protocol-76/00-support*
: set to T to enable support for draft-hixie-76/draft-ietf-hybi-00 protocol
No longer used by current browsers, and doesn't support binary frames. May go away soon.
*max-clients*
: maximum number of simultaneous connections allowed, or NIL
for no limit
*max-read-frame-size*
, *max-read-message-size*
: maximum 'frame' and 'message' sizes allowed from clients.
Malicious clients can cause the server to buffer up to *max-read-message-size*
per connection, so these should probably be reduced as much as possible for production servers.
*debug-on-server-errors*
, *debug-on-resource-errors*
: set to T to enter debugger on errors instead of dropping connections, for the server thread and resource handler thread respectively.
register-global-resource (name resource-handler origin-validation-function)
:
Registers resource-handler
for the resource name
, which should be the abs_path
part of a URI, like /foo/bar
, origin-validation-function
should be a function of one argument which returns true for any origin from which connections will be accepted. See any-origin
,origin-prefix
,origin-exact
. ("Origin" in this case refers to the value of the Origin
or Sec-Webcosket-Origin
header required to be sent by browsers, specifying the host from which the page was loaded, like http://localhost
.)
resource-received-text (resource client message)
: Resource handlers should specialize this generic function to handle text
messages from clients. message
is a lisp string
containing the message from client
.
resource-received-binary (resource client message)
: Resource handlers should specialize this generic function to handle binary
messages from clients. message
is a (vector (unsigned-byte 8))
containing the message from client
.
resource-client-connected (resource client)
: Called to notify a resource handler when a client connects. If the handler objects to a particular client for some reason, it can return :reject
to close the connection and ignore any already received data from that client.
resource-client-disconnected (resource client)
: Called when a client disconnects.
write-to-client-text (client message &key frame-size)
: Send message
to client
. message
should be a CL string
or a (simple-array (unsigned-byte 8) (*))
containing a utf-8 encoded string. If frame-size
is not nil
, message will be broken up into frames of frame-size
octets.
write-to-clients-text (clients message &key frame-size)
: Send message
to a list of clients
. Same as write-to-client-text
, but tries to avoid repeated processing (utf-8 encoding, building frames, etc) that can be shared between clients.
write-to-client-binary (client message &key frame-size)
: Send message
to client
. message
should be a (simple-array (unsigned-byte 8) (*))
. If frame-size
is not nil
, message will be broken up into frames of frame-size
octets.
write-to-clients-binary (clients message &key frame-size)
: Send message
to a list of clients
. Same as write-to-client-binary
, but tries to avoid repeated processing (utf-8 encoding, building frames, etc) that can be shared between clients.
write-to-client-close (client &key (code 1000) message)
: Send a close
message to client
. code
specifies the 'status code' to be send in the close message (see the [websocket spec][http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-15#section-7.4] for valid codes) defaults to 1000, indicating "normal closure". message
can be a short string (must utf-8 encode to < 123 octets) describing the reason for closing the connection.
(most of these should be treated as read-only, and any visible setf
functions may go away at some point)
client-resource-name (client)
: Name of resource requested by client
.
client-query-string (client)
: Query string (the part of the URI after #? if any) provided by client
when connecting.
For example if client connects to ws://example.com/test?foo
, client-resource-name
would return "/test"
and client-query-string
would return "foo"
.
client-websocket-version (client)
: Protocol version being used for specified client
.
client-host (client)
: IP address of client, as a string.
client-port (client)
: Port from which client connected.
client-connection-headers (client)
: Hash table containing any HTTP headers supplied by client
, as a hash table of keywords (:user-agent
, :cookie
, etc) -> strings.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The clws system: |
CLWS implement the WebSocket Protocol as described by
RFC6455[1] (as well as some older drafts implemented by recent
browsers [2][3][4][5]). Only a WebSockets server implementation is
provided.
[1]http://tools.ietf.org/html/rfc6455
[2] http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
[3] http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-08
[4] http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07
[5] http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00
clws.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
Next: The clws/package<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
clws.asd
clws (system)
Next: The clws/sb-concurrency-patch<dot>lisp file, Previous: The clws<dot>asd file, Up: Lisp files [Contents][Index]
Next: The clws/concurrency-sbcl<dot>lisp file, Previous: The clws/package<dot>lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
clws (system)
sb-concurrency-patch.lisp
Next: The clws/util<dot>lisp file, Previous: The clws/sb-concurrency-patch<dot>lisp file, Up: Lisp files [Contents][Index]
sb-concurrency-patch.lisp (file)
clws (system)
concurrency-sbcl.lisp
Next: The clws/config<dot>lisp file, Previous: The clws/concurrency-sbcl<dot>lisp file, Up: Lisp files [Contents][Index]
concurrency-sbcl.lisp (file)
clws (system)
util.lisp
Next: The clws/buffer<dot>lisp file, Previous: The clws/util<dot>lisp file, Up: Lisp files [Contents][Index]
util.lisp (file)
clws (system)
config.lisp
Next: The clws/protocol-common<dot>lisp file, Previous: The clws/config<dot>lisp file, Up: Lisp files [Contents][Index]
config.lisp (file)
clws (system)
buffer.lisp
Next: The clws/protocol-00<dot>lisp file, Previous: The clws/buffer<dot>lisp file, Up: Lisp files [Contents][Index]
buffer.lisp (file)
clws (system)
protocol-common.lisp
Next: The clws/protocol-7<dot>lisp file, Previous: The clws/protocol-common<dot>lisp file, Up: Lisp files [Contents][Index]
protocol-common.lisp (file)
clws (system)
protocol-00.lisp
Next: The clws/protocol<dot>lisp file, Previous: The clws/protocol-00<dot>lisp file, Up: Lisp files [Contents][Index]
protocol-00.lisp (file)
clws (system)
protocol-7.lisp
Next: The clws/client<dot>lisp file, Previous: The clws/protocol-7<dot>lisp file, Up: Lisp files [Contents][Index]
protocol-7.lisp (file)
clws (system)
protocol.lisp
Next: The clws/resource<dot>lisp file, Previous: The clws/protocol<dot>lisp file, Up: Lisp files [Contents][Index]
protocol.lisp (file)
clws (system)
client.lisp
Next: The clws/server<dot>lisp file, Previous: The clws/client<dot>lisp file, Up: Lisp files [Contents][Index]
client.lisp (file)
clws (system)
resource.lisp
Previous: The clws/resource<dot>lisp file, Up: Lisp files [Contents][Index]
resource.lisp (file)
clws (system)
server.lisp
run-server (function)
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The clws-system package: | ||
• The clws package: |
Next: The clws package, Previous: Packages, Up: Packages [Contents][Index]
clws.asd
Previous: The clws-system package, Up: Packages [Contents][Index]
package.lisp (file)
ws
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]
set to T to enter debugger on resource-handler errors, NIL to drop the connections and try to send a disconnect to handler.
config.lisp (file)
set to T to enter debugger on server errors, NIL to just drop the connections.
config.lisp (file)
set to NIL to disable log messages, T to enable
config.lisp (file)
Max number of simultaneous clients allowed (nil for no limit).
Extra connections will get a HTTP 5xx response (without reading headers).
config.lisp (file)
Max size of frames allowed. Connection will be dropped if client sends a larger frame.
config.lisp (file)
set to NIL to disable draft-hixie-76/draft-ietf-00 support, true to enable.
config.lisp (file)
Next: Exported generic functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
resource.lisp (file)
Returns the resource registered via REGISTER-GLOBAL-RESOURCE with name NAME.
resource.lisp (file)
Terminates a RUN-RESOURCE-LISTENER from another thread.
resource.lisp (file)
Returns a function that checks whether a given path matches any of the origins passed as arguments exactly.
resource.lisp (file)
Returns a function that checks whether a given path matches any of the prefixes passed as arguments.
resource.lisp (file)
Registers a resource instance where NAME is a path string like ’/swank’, resource-handler is an instance of WS-RESOURCE, and ORIGIN-VALIDATION-FN is a function that takes an origin string as input and returns T if that origin is allowed to access this resource.
resource.lisp (file)
Runs a resource listener in its own thread indefinitely, calling RESOURCE-CLIENT-DISCONNECTED and RESOURCE-RECEIVED-FRAME as appropriate.
resource.lisp (file)
Starts a server on the given PORT and blocks until the server is
closed. Intended to run in a dedicated thread (the current one),
dubbed the Server Thread.
Establishes a socket listener in the current thread. This thread
handles all incoming connections, and because of this fact is able to
handle far more concurrent connections than it would be able to if it
spawned off a new thread for each connection. As such, most of the
processing is done on the Server Thread, though most user functions
are thread-safe.
server.lisp (file)
Removes the resource registered via REGISTER-GLOBAL-RESOURCE with name NAME.
resource.lisp (file)
writes a binary message to client. MESSAGE should either be an octet vector containing data to be sent. If FRAME-SIZE is set, breaks message into frames no larger than FRAME-SIZE octets.
protocol.lisp (file)
Write a close message to client, and starts closing connection. If set, CODE must be a valid close code for current protocol version, and MESSAGE should be a string that encodes to fewer than 123 octets as UTF8 (it will be ignored otherwise)
protocol.lisp (file)
writes a text message to client. MESSAGE should either be a string, or an octet vector containing a UTF-8 encoded string. If FRAME-SIZE is set, breaks message into frames no larger than FRAME-SIZE octets.
protocol.lisp (file)
Like WRITE-TO-CLIENT-BINARY but sends the message to all of the CLIENTS. Should be faster than separate calls due to only needing to encode and build frames once.
client.lisp (file)
Like WRITE-TO-CLIENT-TEXT but sends the message to all of the clients. Should be faster than separate calls due to only needing to encode and build frames once.
client.lisp (file)
Next: Exported classes, Previous: Exported functions, Up: Exported definitions [Contents][Index]
Funcalls FN on the resource thread of RESOURCE.
resource.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
Decides whether to accept a connection and returns
values to process the connection further. Defaults to accepting all
connections and using the default mailbox and origin, so most resources
shouldn’t need to define a method.
Passed values
- RES is the instance of ws-resource
- RESOURCE-NAME is the resource name requested by the client (string)
- HEADERS is the hash table of headers from the client
- client is the instance of client
Returns values
1. NIL if the connection should be rejected, or non-nil otherwise
2. Concurrent mailbox in which to place messages received from the
client, or NIL for default
3. origin from which to claim this resource is responding, or NIL
for default.
4. handshake-resource or NIL for default
5. protocol or NIL for default
Most of the time this function will just return true for the first
value to accept the connection, and nil for the other values.
Note that the connection is not fully established yet, so this
function should not try to send anything to the client, see
resource-client-connected for that.
This function may be called from a different thread than most resource functions, so methods should be careful about accessing shared data, and should avoid blocking for extended periods.
resource.lisp (file)
Called when a client finishes connecting to a
WebSockets resource, and data can be sent to the client.
Methods can return :reject to immediately close the connection and ignore any already received data from this client.
resource.lisp (file)
Called when a client disconnected from a WebSockets resource.
resource.lisp (file)
Called when a client sent a binary message to a WebSockets resource.
resource.lisp (file)
Called when a client sent a text message to a WebSockets resource.
resource.lisp (file)
Thread-safe way to pass a message to the resource
listener. Any message passed with this function will result in
RESOURCE-RECEIVED-CUSTOM-MESSAGE being called on the resource thread
with the second argument of this function.
resource.lisp (file)
Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
A server may have many resources, each associated
with a particular resource path (like /echo or /chat). An single
instance of a resource handles all requests on the server for that
particular url, with the help of RUN-RESOURCE-LISTENER,
RESOURCE-RECEIVED-FRAME, and RESOURCE-CLIENT-DISCONNECTED.
resource.lisp (file)
standard-object (class)
resource-read-queue (method)
(clws::make-mailbox)
resource-read-queue (generic function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables: | ||
• Internal macros: | ||
• Internal functions: | ||
• Internal generic functions: | ||
• Internal conditions: | ||
• Internal classes: | ||
• Internal types: |
Next: Internal macros, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
config.lisp (file)
config.lisp (file)
config.lisp (file)
client.lisp (file)
protocol-00.lisp (file)
Max number of frames that can be queued before the reader will start throttling reads for clients using that queue (for now, just drops the connections...).
config.lisp (file)
Default max header size in octets (not used yet?)
config.lisp (file)
Largest (incomplete) message allowed. Connection will be dropped if client sends a larger message. Malicious clients can cause lower amounts to be buffered indefinitely though, so be careful with large settings.
config.lisp (file)
Max number of queued write frames before dropping a client.
client.lisp (file)
cross-domain policy file, used for the Flash WebSocket emulator.
config.lisp (file)
protocol.lisp (file)
protocol-common.lisp (file)
hash mapping resource name to (list of handler instance, origin validation function, ?)
resource.lisp (file)
server.lisp (file)
protocol-common.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
buffer.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
client.lisp (file)
Writes given data to specified client, where OCTETS-OR-KEYWORD is either an octet-vector, or :CLOSE, or a list (:CLOSE CLOSE-OCTETS), where CLOSE-OCTETS is an octet vector to send for close frame. If no close frame is provided, a default close frame will be sent.
client.lisp (file)
buffer.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
buffer.lisp (file)
Non-blocking call to dequeue a piece of data from a client’ read-queue.
client.lisp (file)
Non-blocking call to dequeue a piece of data in the write-queue to be sent to the client.
client.lisp (file)
Adds a piece of data to the client’s read-queue so that it may be read and processed.
client.lisp (file)
Adds data to the client’s write-queue and asynchronously send it to the client.
client.lisp (file)
protocol.lisp (file)
Retrieves the oldest value in QUEUE and returns it as the primary value, and T as secondary value. If the queue is empty, returns NIL as both primary and secondary value.
concurrency-sbcl.lisp (file)
resource.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol.lisp (file)
Adds VALUE to the end of QUEUE. Returns VALUE.
concurrency-sbcl.lisp (file)
protocol-00.lisp (file)
protocol-common.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
The non-blocking variant of RECEIVE-MESSAGE. Returns two values, the message removed from MAILBOX, and a flag specifying whether a message could be received.
concurrency-sbcl.lisp (file)
Returns true if MAILBOX is currently empty, NIL otherwise.
concurrency-sbcl.lisp (file)
Returns a fresh list containing all the messages in the mailbox. Does not remove messages from the mailbox.
concurrency-sbcl.lisp (file)
Removes the oldest message from MAILBOX and returns it as the primary value. If MAILBOX is empty waits until a message arrives.
concurrency-sbcl.lisp (file)
The non-blocking variant of RECEIVE-MESSAGE. Returns two values, the message removed from MAILBOX, and a flag specifying whether a message could be received.
concurrency-sbcl.lisp (file)
Removes and returns all (or at most N) currently pending messages
from MAILBOX, or returns NIL if no messages are pending.
Note: Concurrent threads may be snarfing messages during the run of this function, so even though X,Y appear right next to each other in the result, does not necessarily mean that Y was the message sent right after X.
concurrency-sbcl.lisp (file)
Adds a MESSAGE to MAILBOX. Message can be any object.
concurrency-sbcl.lisp (file)
Returns true if MAILBOX is currently empty, NIL otherwise.
concurrency-sbcl.lisp (file)
protocol-00.lisp (file)
Compute the WebSocket opening handshake challenge, according to:
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07#section-1.3
Test this with the example provided in the above document:
(string= (clws::make-challenge-o7 "dGhlIHNhbXBsZSBub25jZQ==")
"s3pPLMBiTxaQ9kYGzzhZRbK+xOo=")
..which must return T.
protocol-7.lisp (file)
Generates a very basic cross-domain policy file, used for the
WebSocket emulation via Flash.
For more information on what that is, see http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html
Given a string, returns bytes that can be transmitted to the client as a WebSockets frame.
client.lisp (file)
protocol-00.lisp (file)
server.lisp (file)
Returns a new MAILBOX with messages in INITIAL-CONTENTS enqueued.
concurrency-sbcl.lisp (file)
Returns a new QUEUE with NAME and contents of the INITIAL-CONTENTS sequence enqueued.
concurrency-sbcl.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
buffer.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
protocol.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-7.lisp (file)
protocol-00.lisp (file)
protocol-00.lisp (file)
protocol-00.lisp (file)
protocol-00.lisp (file)
protocol-7.lisp (file)
protocol.lisp (file)
Certain values, like :close and :enable-read, are special symbols that may be passed to WRITE-TO-CLIENT or otherwise enqueued on the client’s write queue. This predicate returns T if value is one of those special values
client.lisp (file)
protocol.lisp (file)
Should only be called on the server thread,
attempts to flush some of the data in the write-queue in a
non-blocking fashion.
client.lisp (file)
protocol.lisp (file)
Returns non-nil if there is a handler registered for the resource of the given name (a string).
resource.lisp (file)
Next: Internal conditions, Previous: Internal functions, Up: Internal definitions [Contents][Index]
automatically generated reader method
client.lisp (file)
Function to call to send a command to
the network thread from other threads
client.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
State of connection:
:connecting when initially created
:headers while reading headers,
:connected after server handshake sent
:failed after an error has occurred and further input/output will be ignored
:closing when close has been sent but not received from peer (input is still
valid, but no more output will be sent)
client.lisp (file)
Stop listening for READ, WRITE, or ERROR events on the socket for the given client object.
client.lisp (file)
Shutdown 1 or both sides of a connection, close it if both sides shutdown
client.lisp (file)
shutdown 1 or both sides of a connection, close it if both sides shutdown
Enables the read, write, or error handler for a a
client. Once a read handler is set up, the client can handle the
handshake coming in from the client.
client.lisp (file)
client.lisp (file)
Space for handler to store connection specific data.
client.lisp (file)
Flag indicates read side of the connection is closed
client.lisp (file)
queue of decoded lines/frames
client.lisp (file)
Read handler for this queue/socket
client.lisp (file)
client.lisp (file)
The resource object the client has
requested– Not the string, but the object.
client.lisp (file)
The instance of WS:SERVER that owns this client.
client.lisp (file)
Bidirectional socket stream used for communicating with the client.
client.lisp (file)
Flag indicates connection is closed
client.lisp (file)
Buffer being written currently, if
last write couldn’t send whole thing
client.lisp (file)
Flag indicates write side of the connection is closed
client.lisp (file)
Offset into write-buffer if write-buffer is set
client.lisp (file)
Queue of buffers (octet vectors) to
write, or :close to kill connection :enable-read to
reenable reader after being disabled for flow
control (mailbox instead of queue since it tracks
length).
client.lisp (file)
client.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
automatically generated reader method
resource.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
client.lisp (file)
automatically generated writer method
client.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
buffer.lisp (file)
automatically generated reader method
buffer.lisp (file)
automatically generated writer method
buffer.lisp (file)
buffer.lisp (file)
The concurrent mailbox used to pass messages between the server thread and resource thread.
resource.lisp (file)
automatically generated reader method
Called on the resource listener thread when a client is passed an arbitrary message via SEND-CUSTOM-MESSAGE-TO-RESOURCE.
resource.lisp (file)
Returns number the server’s clients.
server.lisp (file)
Hash of client objects to them
selves (just used as a set for now).
server.lisp (file)
automatically generated reader method
server.lisp (file)
automatically generated writer method
server.lisp (file)
Returns a list of the server’s clients.
server.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
buffer.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
buffer.lisp (file)
error (condition)
:status-code
(quote 1000)
status-code (generic function)
:message
(quote nil)
status-message (generic function)
buffer.lisp (file)
error (condition)
:status-code
(quote nil)
status-code (generic function)
:message
(quote nil)
status-message (generic function)
Next: Internal types, Previous: Internal conditions, Up: Internal definitions [Contents][Index]
buffer.lisp (file)
standard-object (class)
:vector
buffer-vector (generic function)
:start
buffer-start (generic function)
:end
buffer-end (generic function)
buffer.lisp (file)
standard-object (class)
client (class)
partial-vector (generic function)
(setf partial-vector) (generic function)
0
partial-vector-pos (generic function)
(setf partial-vector-pos) (generic function)
(make-instance (quote clws::chunk-buffer))
chunks (generic function)
(setf chunks) (generic function)
:predicate
predicate (generic function)
(setf predicate) (generic function)
:callback
callback (generic function)
(setf callback) (generic function)
:error-callback
error-callback (generic function)
(setf error-callback) (generic function)
buffer.lisp (file)
standard-object (class)
0
buffer-size (generic function)
(setf buffer-size) (generic function)
chunks (generic function)
(setf chunks) (generic function)
end-of-chunks (generic function)
(setf end-of-chunks) (generic function)
Per-client data used by a WebSockets server.
client.lisp (file)
buffered-reader (class)
The instance of WS:SERVER that owns this client.
:server
client-server (generic function)
The resource object the client has
requested– Not the string, but the object.
:resource
client-resource (generic function)
(setf client-resource) (generic function)
:port
client-port (generic function)
:host
client-host (generic function)
:%host
%client-host (generic function)
Function to call to send a command to
the network thread from other threads
:server-hook
%client-server-hook (generic function)
Bidirectional socket stream used for communicating with the client.
:socket
client-socket (generic function)
Flag indicates read side of the connection is closed
client-read-closed (generic function)
(setf client-read-closed) (generic function)
Flag indicates write side of the connection is closed
client-write-closed (generic function)
(setf client-write-closed) (generic function)
Flag indicates connection is closed
client-socket-closed (generic function)
(setf client-socket-closed) (generic function)
Buffer being written currently, if
last write couldn’t send whole thing
client-write-buffer (generic function)
(setf client-write-buffer) (generic function)
Offset into write-buffer if write-buffer is set
0
client-write-offset (generic function)
(setf client-write-offset) (generic function)
Queue of buffers (octet vectors) to
write, or :close to kill connection :enable-read to
reenable reader after being disabled for flow
control (mailbox instead of queue since it tracks
length).
(clws::make-mailbox)
client-write-queue (generic function)
queue of decoded lines/frames
(clws::make-mailbox)
client-read-queue (generic function)
(setf client-read-queue) (generic function)
State of connection:
:connecting when initially created
:headers while reading headers,
:connected after server handshake sent
:failed after an error has occurred and further input/output will be ignored
:closing when close has been sent but not received from peer (input is still
valid, but no more output will be sent)
:connecting
client-connection-state (generic function)
(setf client-connection-state) (generic function)
Read handler for this queue/socket
client-reader (generic function)
(setf client-reader) (generic function)
Space for handler to store connection specific data.
client-handler-data (generic function)
(setf client-handler-data) (generic function)
client-connection-headers (generic function)
(setf client-connection-headers) (generic function)
client-resource-name (generic function)
(setf client-resource-name) (generic function)
client-query-string (generic function)
(setf client-query-string) (generic function)
client-websocket-version (generic function)
(setf client-websocket-version) (generic function)
partial-message (generic function)
(setf partial-message) (generic function)
message-opcode (generic function)
(setf message-opcode) (generic function)
frame-opcode-octet (generic function)
(setf frame-opcode-octet) (generic function)
frame-opcode (generic function)
(setf frame-opcode) (generic function)
frame-fin (generic function)
(setf frame-fin) (generic function)
frame-length (generic function)
(setf frame-length) (generic function)
client-connection-rejected (generic function)
(setf client-connection-rejected) (generic function)
A type of so-called ’custom message’ used to call a function on the main resource thread.
resource.lisp (file)
standard-object (class)
:function
message-function (generic function)
A WebSockets server listens on a socket for
connections and has a bunch of client instances that it controls.
server.lisp (file)
standard-object (class)
:event-base
server-event-base (generic function)
(setf server-event-base) (generic function)
Hash of client objects to them
selves (just used as a set for now).
(make-hash-table)
server-clients (generic function)
Previous: Internal classes, Up: Internal definitions [Contents][Index]
client.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: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A B C D E F G I K L M N O P R S T U V W |
---|
Jump to: | %
(
A B C D E F G I K L M N O P R S T U V W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | %
*
B C E F H M P Q R S V W |
---|
Jump to: | %
*
B C E F H M P Q R S V W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | B C F P S T W |
---|
Jump to: | B C F P S T W |
---|