This is the clws Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:43:53 2024 GMT+0.
clws/clws.asd
clws/package.lisp
clws/sb-concurrency-patch.lisp
clws/concurrency-sbcl.lisp
clws/util.lisp
clws/config.lisp
clws/buffer.lisp
clws/protocol-common.lisp
clws/protocol-00.lisp
clws/protocol-7.lisp
clws/protocol.lisp
clws/client.lisp
clws/resource.lisp
clws/server.lisp
The main system appears first, followed by any subsystem dependency.
clws
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
sb-concurrency
(system).
iolib
(system).
ironclad
(system).
chunga
(system).
cl-base64
(system).
flexi-streams
(system).
split-sequence
(system).
package.lisp
(file).
sb-concurrency-patch.lisp
(file).
concurrency-sbcl.lisp
(file).
util.lisp
(file).
config.lisp
(file).
buffer.lisp
(file).
protocol-common.lisp
(file).
protocol-00.lisp
(file).
protocol-7.lisp
(file).
protocol.lisp
(file).
client.lisp
(file).
resource.lisp
(file).
server.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
clws/clws.asd
clws/package.lisp
clws/sb-concurrency-patch.lisp
clws/concurrency-sbcl.lisp
clws/util.lisp
clws/config.lisp
clws/buffer.lisp
clws/protocol-common.lisp
clws/protocol-00.lisp
clws/protocol-7.lisp
clws/protocol.lisp
clws/client.lisp
clws/resource.lisp
clws/server.lisp
clws/sb-concurrency-patch.lisp
package.lisp
(file).
clws
(system).
clws/concurrency-sbcl.lisp
sb-concurrency-patch.lisp
(file).
clws
(system).
dequeue
(function).
enqueue
(function).
mailbox-count
(function).
mailbox-empty-p
(function).
mailbox-list-messages
(function).
mailbox-receive-message
(function).
mailbox-receive-message-no-hang
(function).
mailbox-receive-pending-messages
(function).
mailbox-send-message
(function).
mailboxp
(function).
make-mailbox
(function).
make-queue
(function).
clws/util.lisp
concurrency-sbcl.lisp
(file).
clws
(system).
lg
(function).
make-array-ubyte8
(macro).
make-domain-policy
(function).
string-to-shareable-octets
(function).
clws/config.lisp
util.lisp
(file).
clws
(system).
*debug-on-resource-errors*
(special variable).
*debug-on-server-errors*
(special variable).
*log-level*
(special variable).
*max-clients*
(special variable).
*max-read-frame-size*
(special variable).
*protocol-76/00-support*
(special variable).
*400-message*
(special variable).
*403-message*
(special variable).
*404-message*
(special variable).
*max-handler-read-backlog*
(special variable).
*max-header-size*
(special variable).
*max-read-message-size*
(special variable).
*policy-file*
(special variable).
clws/buffer.lisp
config.lisp
(file).
clws
(system).
%get-chunks
(method).
%get-chunks
(method).
add-chunk
(method).
add-chunks
(method).
add-reader-to-client
(function).
buffer-chunk
(class).
buffer-count
(method).
buffer-end
(reader method).
buffer-size
(reader method).
(setf buffer-size)
(writer method).
buffer-start
(reader method).
buffer-vector
(reader method).
buffered-reader
(class).
call-with-buffer-as-stream
(function).
callback
(reader method).
(setf callback)
(writer method).
chunk-buffer
(class).
chunks
(reader method).
chunks
(reader method).
(setf chunks)
(writer method).
(setf chunks)
(writer method).
close-from-peer
(condition).
end-of-chunks
(reader method).
(setf end-of-chunks)
(writer method).
error-callback
(reader method).
(setf error-callback)
(writer method).
fail-the-websockets-connection
(condition).
get-octet-vector
(method).
get-utf8-string
(method).
mask-octets
(method).
next-reader-state
(function).
partial-vector
(reader method).
(setf partial-vector)
(writer method).
partial-vector-pos
(reader method).
(setf partial-vector-pos)
(writer method).
peek-octet
(method).
predicate
(reader method).
(setf predicate)
(writer method).
read-octet
(method).
status-code
(reader method).
status-code
(reader method).
status-message
(reader method).
status-message
(reader method).
with-buffer-as-stream
(macro).
clws/protocol-common.lisp
buffer.lisp
(file).
clws
(system).
*protocol-header-parsers*
(special variable).
*supported-protocol-versions*
(special variable).
get-utf8-string-or-fail
(function).
clws/protocol-00.lisp
protocol-common.lisp
(file).
clws
(system).
*draft-76/00-close-frame*
(special variable).
extract-key
(function).
make-challenge-00
(function).
make-handshake-76
(function).
protocol-76/00-frame-start
(function).
protocol-76/00-nonce
(function).
protocol-76/00-read-binary-frame
(function).
protocol-76/00-read-text-frame
(function).
clws/protocol-7.lisp
protocol-00.lisp
(file).
clws
(system).
dispatch-control-message
(function).
dispatch-frame
(function).
dispatch-message
(function).
make-challenge-o7
(function).
protocol-13-parse-headers
(function).
protocol-7+-extended-length
(function).
protocol-7+-handshake
(function).
protocol-7+-read-frame
(function).
protocol-7+-read-mask
(function).
protocol-7+-start-frame
(function).
protocol-7-parse-headers
(function).
protocol-8-parse-headers
(function).
clws/protocol.lisp
protocol-7.lisp
(file).
clws
(system).
write-to-client-binary
(function).
write-to-client-close
(function).
write-to-client-text
(function).
*policy-file-request*
(special variable).
binary-message-for-protocol
(function).
build-frames
(function).
close-frame-for-protocol
(function).
dispatch-protocols
(function).
ignore-remaining-input
(function).
invalid-header
(function).
match-headers
(function).
match-policy-file
(function).
match-resource-line
(function).
maybe-policy-file
(function).
octet-count-matcher
(function).
octet-pattern-matcher
(function).
pong-frame-for-protocol
(function).
send-error-and-close
(function).
text-message-for-protocol
(function).
unsupported-protocol-version
(function).
clws/client.lisp
protocol.lisp
(file).
clws
(system).
client-connection-headers
(reader method).
(setf client-connection-headers)
(writer method).
client-connection-rejected
(reader method).
(setf client-connection-rejected)
(writer method).
client-host
(reader method).
client-port
(reader method).
client-query-string
(reader method).
(setf client-query-string)
(writer method).
client-resource-name
(reader method).
(setf client-resource-name)
(writer method).
client-websocket-version
(reader method).
(setf client-websocket-version)
(writer method).
write-to-clients-binary
(function).
write-to-clients-text
(function).
%client-enqueue-write-or-kill
(function).
%client-host
(reader method).
%client-server-hook
(reader method).
%write-to-client
(function).
*close-frame*
(special variable).
*max-write-backlog*
(special variable).
client
(class).
client-connection-state
(reader method).
(setf client-connection-state)
(writer method).
client-dequeue-read
(function).
client-dequeue-write
(function).
client-disable-handler
(generic function).
client-disconnect
(generic function).
client-enable-handler
(generic function).
client-enqueue-read
(function).
client-enqueue-write
(function).
client-error-active
(method).
client-handler-data
(reader method).
(setf client-handler-data)
(writer method).
client-read-closed
(reader method).
(setf client-read-closed)
(writer method).
client-read-queue
(reader method).
(setf client-read-queue)
(writer method).
client-reader
(reader method).
(setf client-reader)
(writer method).
client-reader-active
(method).
client-resource
(reader method).
(setf client-resource)
(writer method).
client-server
(reader method).
client-socket
(reader method).
client-socket-closed
(reader method).
(setf client-socket-closed)
(writer method).
client-write-buffer
(reader method).
(setf client-write-buffer)
(writer method).
client-write-closed
(reader method).
(setf client-write-closed)
(writer method).
client-write-control-keyword
(type).
client-write-offset
(reader method).
(setf client-write-offset)
(writer method).
client-write-queue
(reader method).
client-writer-active
(method).
frame-fin
(reader method).
(setf frame-fin)
(writer method).
frame-length
(reader method).
(setf frame-length)
(writer method).
frame-opcode
(reader method).
(setf frame-opcode)
(writer method).
frame-opcode-octet
(reader method).
(setf frame-opcode-octet)
(writer method).
make-frame-from-string
(function).
message-opcode
(reader method).
(setf message-opcode)
(writer method).
partial-message
(reader method).
(setf partial-message)
(writer method).
special-client-write-value-p
(function).
try-write-client
(function).
clws/resource.lisp
client.lisp
(file).
clws
(system).
any-origin
(function).
call-on-resource-thread
(generic function).
find-global-resource
(function).
kill-resource-listener
(function).
origin-exact
(function).
origin-prefix
(function).
register-global-resource
(function).
resource-accept-connection
(generic function).
resource-client-connected
(generic function).
resource-client-disconnected
(generic function).
resource-received-binary
(generic function).
resource-received-text
(generic function).
run-resource-listener
(function).
send-custom-message-to-resource
(generic function).
unregister-global-resource
(function).
ws-resource
(class).
*resources*
(special variable).
disconnect-client
(function).
funcall-custom-message
(class).
message-function
(reader method).
resource-read-queue
(generic reader).
resource-received-custom-message
(generic function).
valid-resource-p
(function).
clws/server.lisp
resource.lisp
(file).
clws
(system).
run-server
(function).
*server-busy-message*
(special variable).
make-listener-handler
(function).
server
(class).
server-client-count
(generic function).
server-clients
(reader method).
server-event-base
(reader method).
(setf server-event-base)
(writer method).
server-list-clients
(generic function).
Packages are listed by definition order.
clws
ws
common-lisp
.
iolib
.
*debug-on-resource-errors*
(special variable).
*debug-on-server-errors*
(special variable).
*log-level*
(special variable).
*max-clients*
(special variable).
*max-read-frame-size*
(special variable).
*protocol-76/00-support*
(special variable).
any-origin
(function).
call-on-resource-thread
(generic function).
client-connection-headers
(generic reader).
(setf client-connection-headers)
(generic writer).
client-connection-rejected
(generic reader).
(setf client-connection-rejected)
(generic writer).
client-host
(generic reader).
client-port
(generic reader).
client-query-string
(generic reader).
(setf client-query-string)
(generic writer).
client-resource-name
(generic reader).
(setf client-resource-name)
(generic writer).
client-websocket-version
(generic reader).
(setf client-websocket-version)
(generic writer).
find-global-resource
(function).
kill-resource-listener
(function).
origin-exact
(function).
origin-prefix
(function).
register-global-resource
(function).
resource-accept-connection
(generic function).
resource-client-connected
(generic function).
resource-client-disconnected
(generic function).
resource-received-binary
(generic function).
resource-received-text
(generic function).
run-resource-listener
(function).
run-server
(function).
send-custom-message-to-resource
(generic function).
unregister-global-resource
(function).
write-to-client-binary
(function).
write-to-client-close
(function).
write-to-client-text
(function).
write-to-clients-binary
(function).
write-to-clients-text
(function).
ws-resource
(class).
%client-enqueue-write-or-kill
(function).
%client-host
(generic reader).
%client-server-hook
(generic reader).
%get-chunks
(generic function).
%write-to-client
(function).
*400-message*
(special variable).
*403-message*
(special variable).
*404-message*
(special variable).
*close-frame*
(special variable).
*draft-76/00-close-frame*
(special variable).
*max-handler-read-backlog*
(special variable).
*max-header-size*
(special variable).
*max-read-message-size*
(special variable).
*max-write-backlog*
(special variable).
*policy-file*
(special variable).
*policy-file-request*
(special variable).
*protocol-header-parsers*
(special variable).
*resources*
(special variable).
*server-busy-message*
(special variable).
*supported-protocol-versions*
(special variable).
add-chunk
(generic function).
add-chunks
(generic function).
add-reader-to-client
(function).
binary-message-for-protocol
(function).
buffer-chunk
(class).
buffer-count
(generic function).
buffer-end
(generic reader).
buffer-size
(generic reader).
(setf buffer-size)
(generic writer).
buffer-start
(generic reader).
buffer-vector
(generic reader).
buffered-reader
(class).
build-frames
(function).
call-with-buffer-as-stream
(function).
callback
(generic reader).
(setf callback)
(generic writer).
chunk-buffer
(class).
chunks
(generic reader).
(setf chunks)
(generic writer).
client
(class).
client-connection-state
(generic reader).
(setf client-connection-state)
(generic writer).
client-dequeue-read
(function).
client-dequeue-write
(function).
client-disable-handler
(generic function).
client-disconnect
(generic function).
client-enable-handler
(generic function).
client-enqueue-read
(function).
client-enqueue-write
(function).
client-error-active
(generic function).
client-handler-data
(generic reader).
(setf client-handler-data)
(generic writer).
client-read-closed
(generic reader).
(setf client-read-closed)
(generic writer).
client-read-queue
(generic reader).
(setf client-read-queue)
(generic writer).
client-reader
(generic reader).
(setf client-reader)
(generic writer).
client-reader-active
(generic function).
client-resource
(generic reader).
(setf client-resource)
(generic writer).
client-server
(generic reader).
client-socket
(generic reader).
client-socket-closed
(generic reader).
(setf client-socket-closed)
(generic writer).
client-write-buffer
(generic reader).
(setf client-write-buffer)
(generic writer).
client-write-closed
(generic reader).
(setf client-write-closed)
(generic writer).
client-write-control-keyword
(type).
client-write-offset
(generic reader).
(setf client-write-offset)
(generic writer).
client-write-queue
(generic reader).
client-writer-active
(generic function).
close-frame-for-protocol
(function).
close-from-peer
(condition).
dequeue
(function).
disconnect-client
(function).
dispatch-control-message
(function).
dispatch-frame
(function).
dispatch-message
(function).
dispatch-protocols
(function).
end-of-chunks
(generic reader).
(setf end-of-chunks)
(generic writer).
enqueue
(function).
error-callback
(generic reader).
(setf error-callback)
(generic writer).
extract-key
(function).
fail-the-websockets-connection
(condition).
frame-fin
(generic reader).
(setf frame-fin)
(generic writer).
frame-length
(generic reader).
(setf frame-length)
(generic writer).
frame-opcode
(generic reader).
(setf frame-opcode)
(generic writer).
frame-opcode-octet
(generic reader).
(setf frame-opcode-octet)
(generic writer).
funcall-custom-message
(class).
get-octet-vector
(generic function).
get-utf8-string
(generic function).
get-utf8-string-or-fail
(function).
ignore-remaining-input
(function).
invalid-header
(function).
lg
(function).
mailbox-count
(function).
mailbox-empty-p
(function).
mailbox-list-messages
(function).
mailbox-receive-message
(function).
mailbox-receive-message-no-hang
(function).
mailbox-receive-pending-messages
(function).
mailbox-send-message
(function).
mailboxp
(function).
make-array-ubyte8
(macro).
make-challenge-00
(function).
make-challenge-o7
(function).
make-domain-policy
(function).
make-frame-from-string
(function).
make-handshake-76
(function).
make-listener-handler
(function).
make-mailbox
(function).
make-queue
(function).
mask-octets
(generic function).
match-headers
(function).
match-policy-file
(function).
match-resource-line
(function).
maybe-policy-file
(function).
message-function
(generic reader).
message-opcode
(generic reader).
(setf message-opcode)
(generic writer).
next-reader-state
(function).
octet-count-matcher
(function).
octet-pattern-matcher
(function).
partial-message
(generic reader).
(setf partial-message)
(generic writer).
partial-vector
(generic reader).
(setf partial-vector)
(generic writer).
partial-vector-pos
(generic reader).
(setf partial-vector-pos)
(generic writer).
peek-octet
(generic function).
pong-frame-for-protocol
(function).
predicate
(generic reader).
(setf predicate)
(generic writer).
protocol-13-parse-headers
(function).
protocol-7+-extended-length
(function).
protocol-7+-handshake
(function).
protocol-7+-read-frame
(function).
protocol-7+-read-mask
(function).
protocol-7+-start-frame
(function).
protocol-7-parse-headers
(function).
protocol-76/00-frame-start
(function).
protocol-76/00-nonce
(function).
protocol-76/00-read-binary-frame
(function).
protocol-76/00-read-text-frame
(function).
protocol-8-parse-headers
(function).
read-octet
(generic function).
resource-read-queue
(generic reader).
resource-received-custom-message
(generic function).
send-error-and-close
(function).
server
(class).
server-client-count
(generic function).
server-clients
(generic reader).
server-event-base
(generic reader).
(setf server-event-base)
(generic writer).
server-list-clients
(generic function).
special-client-write-value-p
(function).
status-code
(generic reader).
status-message
(generic reader).
string-to-shareable-octets
(function).
text-message-for-protocol
(function).
try-write-client
(function).
unsupported-protocol-version
(function).
valid-resource-p
(function).
with-buffer-as-stream
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
set to T to enter debugger on resource-handler errors, NIL to drop the connections and try to send a disconnect to handler.
clws
.
set to T to enter debugger on server errors, NIL to just drop the connections.
clws
.
set to NIL to disable log messages, T to enable
clws
.
Max number of simultaneous clients allowed (nil for no limit).
Extra connections will get a HTTP 5xx response (without reading headers).
clws
.
Max size of frames allowed. Connection will be dropped if client sends a larger frame.
clws
.
set to NIL to disable draft-hixie-76/draft-ietf-00 support, true to enable.
clws
.
Returns the resource registered via REGISTER-GLOBAL-RESOURCE with name NAME.
clws
.
Terminates a RUN-RESOURCE-LISTENER from another thread.
clws
.
Returns a function that checks whether a given path matches any of the origins passed as arguments exactly.
clws
.
Returns a function that checks whether a given path matches any of the prefixes passed as arguments.
clws
.
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.
clws
.
Runs a resource listener in its own thread indefinitely, calling RESOURCE-CLIENT-DISCONNECTED and RESOURCE-RECEIVED-FRAME as appropriate.
clws
.
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.
clws
.
Removes the resource registered via REGISTER-GLOBAL-RESOURCE with name NAME.
clws
.
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.
clws
.
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)
clws
.
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.
clws
.
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.
clws
.
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.
clws
.
Funcalls FN on the resource thread of RESOURCE.
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.
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.
Called when a client disconnected from a WebSockets resource.
clws
.
Called when a client sent a binary message to a WebSockets resource.
clws
.
Called when a client sent a text message to a WebSockets resource.
clws
.
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.
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.
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...).
clws
.
Default max header size in octets (not used yet?)
clws
.
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.
clws
.
Max number of queued write frames before dropping a client.
clws
.
cross-domain policy file, used for the Flash WebSocket emulator.
clws
.
hash mapping resource name to (list of handler instance, origin validation function, ?)
clws
.
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.
clws
.
Non-blocking call to dequeue a piece of data from a client’ read-queue.
clws
.
Non-blocking call to dequeue a piece of data in the write-queue to be sent to the client.
clws
.
Adds a piece of data to the client’s read-queue so that it may be read and processed.
clws
.
Adds data to the client’s write-queue and asynchronously send it to the client.
clws
.
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.
clws
.
Adds VALUE to the end of QUEUE. Returns VALUE.
clws
.
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.
clws
.
Returns true if MAILBOX is currently empty, NIL otherwise.
clws
.
Returns a fresh list containing all the messages in the mailbox. Does not remove messages from the mailbox.
clws
.
Removes the oldest message from MAILBOX and returns it as the primary value. If MAILBOX is empty waits until a message arrives.
clws
.
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.
clws
.
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.
clws
.
Adds a MESSAGE to MAILBOX. Message can be any object.
clws
.
Returns true if MAILBOX is currently empty, NIL otherwise.
clws
.
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.
clws
.
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.
clws
.
Returns a new MAILBOX with messages in INITIAL-CONTENTS enqueued.
clws
.
Returns a new QUEUE with NAME and contents of the INITIAL-CONTENTS sequence enqueued.
clws
.
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
clws
.
Should only be called on the server thread,
attempts to flush some of the data in the write-queue in a
non-blocking fashion.
clws
.
Returns non-nil if there is a handler registered for the resource of the given name (a string).
clws
.
clws
.
buffered-reader
)) ¶chunk-buffer
)) ¶clws
.
chunk-buffer
) vector start end) ¶clws
.
chunk-buffer
) (more chunk-buffer
)) ¶clws
.
buffer-chunk
)) ¶clws
.
buffer-chunk
)) ¶automatically generated reader method
end
.
clws
.
chunk-buffer
)) ¶automatically generated reader method
clws
.
chunk-buffer
)) ¶automatically generated writer method
clws
.
buffer-chunk
)) ¶automatically generated reader method
clws
.
buffer-chunk
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
clws
.
buffered-reader
)) ¶automatically generated reader method
chunk-buffer
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
chunk-buffer
)) ¶automatically generated writer method
clws
.
client
)) ¶client
)) ¶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)
Stop listening for READ, WRITE, or ERROR events on the socket for the given client object.
clws
.
Shutdown 1 or both sides of a connection, close it if both sides shutdown
clws
.
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.
clws
.
clws
.
chunk-buffer
)) ¶automatically generated reader method
clws
.
chunk-buffer
)) ¶automatically generated writer method
clws
.
buffered-reader
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
clws
.
chunk-buffer
)) ¶clws
.
chunk-buffer
) &key errorp octet-end) ¶clws
.
chunk-buffer
) mask) ¶clws
.
funcall-custom-message
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
clws
.
buffered-reader
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
clws
.
chunk-buffer
)) ¶clws
.
buffered-reader
)) ¶automatically generated reader method
clws
.
buffered-reader
)) ¶automatically generated writer method
clws
.
chunk-buffer
)) ¶The concurrent mailbox used to pass messages between the server thread and resource thread.
clws
.
ws-resource
)) ¶automatically generated reader method
Called on the resource listener thread when a client is passed an arbitrary message via SEND-CUSTOM-MESSAGE-TO-RESOURCE.
clws
.
funcall-custom-message
)) ¶Returns number the server’s clients.
clws
.
Returns a list of the server’s clients.
clws
.
clws
.
close-from-peer
)) ¶code
.
fail-the-websockets-connection
)) ¶code
.
clws
.
close-from-peer
)) ¶fail-the-websockets-connection
)) ¶clws
.
0
(make-instance (quote clws::chunk-buffer))
:predicate
:callback
:error-callback
Per-client data used by a WebSockets server.
clws
.
%client-host
.
%client-server-hook
.
(setf client-connection-headers)
.
client-connection-headers
.
(setf client-connection-rejected)
.
client-connection-rejected
.
(setf client-connection-state)
.
client-connection-state
.
client-disable-handler
.
client-disconnect
.
client-enable-handler
.
client-error-active
.
(setf client-handler-data)
.
client-handler-data
.
client-host
.
client-port
.
(setf client-query-string)
.
client-query-string
.
(setf client-read-closed)
.
client-read-closed
.
(setf client-read-queue)
.
client-read-queue
.
(setf client-reader)
.
client-reader
.
client-reader-active
.
(setf client-resource)
.
client-resource
.
(setf client-resource-name)
.
client-resource-name
.
client-server
.
client-socket
.
(setf client-socket-closed)
.
client-socket-closed
.
(setf client-websocket-version)
.
client-websocket-version
.
(setf client-write-buffer)
.
client-write-buffer
.
(setf client-write-closed)
.
client-write-closed
.
(setf client-write-offset)
.
client-write-offset
.
client-write-queue
.
client-writer-active
.
(setf frame-fin)
.
frame-fin
.
(setf frame-length)
.
frame-length
.
(setf frame-opcode)
.
frame-opcode
.
(setf frame-opcode-octet)
.
frame-opcode-octet
.
(setf message-opcode)
.
message-opcode
.
(setf partial-message)
.
partial-message
.
The instance of WS:SERVER that owns this client.
:server
This slot is read-only.
The resource object the client has
requested– Not the string, but the object.
:resource
:port
This slot is read-only.
:host
This slot is read-only.
:%host
This slot is read-only.
Function to call to send a command to
the network thread from other threads
:server-hook
This slot is read-only.
Bidirectional socket stream used for communicating with the client.
iolib/sockets
.
:socket
This slot is read-only.
Flag indicates read side of the connection is closed
Flag indicates write side of the connection is closed
Flag indicates connection is closed
Buffer being written currently, if
last write couldn’t send whole thing
Offset into write-buffer if write-buffer is set
0
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)
This slot is read-only.
queue of decoded lines/frames
(clws::make-mailbox)
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
Read handler for this queue/socket
Space for handler to store connection specific data.
A type of so-called ’custom message’ used to call a function on the main resource thread.
A WebSockets server listens on a socket for
connections and has a bunch of client instances that it controls.
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 |
---|
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 |
---|
Jump to: | B C F P R S T U W |
---|
Jump to: | B C F P R S T U W |
---|