Changeset 31627 in project

10/09/14 01:32:27 (6 years ago)

Anonymous wiki edit for IP []: Add list of errors and message types.

1 edited


  • wiki/eggref/4/websockets

    r31626 r31627  
    163163The main difference between {{with-websocket}} and {{with-concurrent-websocket}} is that messages are guaranteed to be delivered in order with {{with-websocket}}. This also means that no messages will be read into memory and processed unless a call is made to {{receive-message}}. This includes pong messages that may be sent in response to any pings sent in the background ping thread, if enabled. See the definition of {{ping-interval}} for more details on how background pings and pongs work.
     165A list of possible message types and their respective websocket codes:
     168<tr><th>message type (symbol)</th><th>code</th></tr>
    165177==== {{with-websocket}}
    166178<procedure>(with-websocket [procedure])</procedure>
    337349Returns the optype (or message type) of the fragment as a symbol.
     351=== Exceptions
     353Possible exceptions and a brief description. See individual function definitions for details on when specific ones will be triggered.
     357<tr><td>websocket</td><td>A part of every websocket error as a composite condition. You can use this as a catchall for all websocket related errors.</td></tr>
     358<tr><td>protocol-error</td><td>Anytime something happens that violates the websocket protocol. The {{msg}} error property will contain details on the protocol broken.</td></tr>
     359<tr><td>invalid-optype</td><td>If an invalid message type (optype) is passed into any method that takes it as an argument.</td></tr>
     360<tr><td>reserved-bits-not-supported</td><td>A frame had a reserved bit set.</td></tr>
     361<tr><td>message-too-large</td><td>A message exceeds the set {{(max-frame-size)}} or {{(max-message-size)}} parameters.</td></tr>
     362<tr><td>unhandled-optype</td><td>The implementation received a frame with an opcode it could not handle. The {{optype}} property contains the unhandleable optype (as produced by {{(opcode->optype)}}).</td></tr>
     363<tr><td>invalid-data</td><td>Currently only signaled when a text payload contains invalid UTF8 codepoints. The {{msg}} property will hold a description of the "invalid data".</td></tr>
     364<tr><td>missing-header-upgrade</td><td>The request does not contain an "upgrade" parameter or it is not set to "websocket".</td></tr>
     365<tr><td>connection-timeout</td><td>The connection has timed out.</td></tr>
    339369=== Contributors
Note: See TracChangeset for help on using the changeset viewer.