Plain Messages

HANDSHAKE_COMPLETE P(1)

Sent by the server after receiving the client's affirmative handshake reply. Do not send any messages to the server until this message is received. After receiving this, the client should announce itself. See Post-Handshake Exchange.

ANNOUNCE_SERVER P(2) serverid termid version hops nterms key+value...

Sent by the server to notify the client of a newly connected server. This includes the server to which the client is directly connected (the "immediate server").

  • serverid (16): The server identifier.
  • peerid (16): The object to which the server is connected. For the immediate server, this is the client's own identifier. For other servers, this is a terminal or connection identifier.
  • version (4): The server's protocol minor version, as in the handshake message.
  • hops (4): The number of hops (connections) separating the server from the client. For the immediate server, this is zero.
  • nterms (4): The number of terminals on the server. An announcement will follow for each terminal (most of the time; there is a race condition where a terminal can be closed). See Post-Handshake Exchange for more information.
  • key+value: The server's attributes as NUL-terminated UTF-8 strings.
ANNOUNCE_TERM P(3) termid serverid hops width height key+value...

Sent by the server to notify the client of a new terminal.

  • termid (16): The terminal identifier.
  • serverid (16): The parent server identifier.
  • hops (4): The number of hops (connections) separating the terminal's parent server from the client. For the immediate server, this is zero.
  • width (4): The width of the terminal in character cells.
  • height (4): The height of the terminal in character cells.
  • key+value: The terminal's attributes as NUL-terminated UTF-8 strings.
ANNOUNCE_CONN P(4) connid serverid hops key+value...

Sent by the server to notify the client of a new connection.

  • connid (16): The connection identifier.
  • serverid (16): The parent server identifier.
  • hops (4): The number of hops (connections) separating the connection's parent server from the client. For the immediate server, this is zero.
  • key+value: The connection's attributes as NUL-terminated UTF-8 strings.
DISCONNECT P(5) code?

May be sent by the server or client at any time in order to end the connection. Close the connection after sending or receiving this.

  • code (4): An error code. This may not be present in the message, in which case it should be treated as 5 (forwarding error).
KEEPALIVE P(6)

After keepalives have been configured, the server will send these periodically. The client should respond to a keepalive by sending one back to the server.

CONFIGURE_KEEPALIVE P(7) timeout

Sets up keepalive messages on the connection. The client should send this before announcing itself. See Post-Handshake Exchange.

  • timeout (4): The requested time between KEEPALIVE messages in milliseconds. The client should disconnect if a keepalive message is not received within twice the specified time period. The client should respond to a keepalive by sending one back to the server.
DISCARD P(9) data

A message containing arbitrary data which will be ignored by the server. When using the 8-bit "raw" protocol encoding, the client can use this to perform a "channel test" by sending potentially troublesome escape sequences such as ~. in the data.