|
YAACC - UPNP Client and Server
|
The encrypted channel after the handshake: every WebSocket binary message is one Noise transport message whose plaintext is a message id byte followed by the body (id 0: a JSON message, 1: a fragment of a larger message, 4 to 7: player audio ...). More...

Classes | |
| class | Inbound |
| A message after decryption (and reassembly): its id and its body. | |
Public Member Functions | |
| SecureChannel (WsConnection ws, NoiseTransport transport) | |
| boolean | isPlain () |
| True for the plain channel of the older wire. | |
| NoiseTransport | transport () |
| void | sendJson (String json) throws IOException |
| Sends a JSON message (id 0). | |
| void | sendMessage (int id, byte[] body) throws IOException |
| Sends a binary message of the given id. | |
| Inbound | receive () throws IOException, ProtocolException, NoiseException |
| Blocks for the next message. | |
| void | close (int code) |
| Sends a close frame; the caller closes the socket. | |
Static Public Member Functions | |
| static SecureChannel | plain (WsConnection ws) |
| The channel of the older, unencrypted wire (the "transition mode", only when the user allows it): a JSON message is a WebSocket text message, anything else a binary message that starts with its id byte. | |
Static Public Attributes | |
| static final int | MAX_BODY = NoiseTransport.MAX_PLAINTEXT_LENGTH - 1 |
| The room of one transport message: the plaintext holds the id byte and the body. | |
The encrypted channel after the handshake: every WebSocket binary message is one Noise transport message whose plaintext is a message id byte followed by the body (id 0: a JSON message, 1: a fragment of a larger message, 4 to 7: player audio ...).
Sending is serialized: encrypting and writing happen under one lock, so the counters run in the order of the frames on the wire. Reading is for one thread. A text message, a message that does not verify, an empty one and every malformed fragment sequence end the connection (the caller closes).
|
static |
The channel of the older, unencrypted wire (the "transition mode", only when the user allows it): a JSON message is a WebSocket text message, anything else a binary message that starts with its id byte.
There is no transport and nothing is encrypted.
Referenced by de.yaacc.sendspin.session.SecureChannel.receive(), and de.yaacc.sendspin.session.SecureChannel.sendMessage().

| Inbound de.yaacc.sendspin.session.SecureChannel.receive | ( | ) | throws IOException, ProtocolException, NoiseException |
Blocks for the next message.
| java.net.SocketTimeoutException | if nothing arrived (the connection is intact) |
| ProtocolException | if the peer broke a rule of the protocol (close) |
| NoiseException | if a message does not verify (close without a message) |

| void de.yaacc.sendspin.session.SecureChannel.sendMessage | ( | int | id, |
| byte[] | body ) throws IOException |
Sends a binary message of the given id.
| body | at most MAX_BODY bytes (larger messages are not sent by this server role yet) |
Referenced by de.yaacc.sendspin.session.SecureChannel.sendJson().

