Skip to main content

Module protocol

Module protocol 

Source
Expand description

Protocol definitions for client-server communication

The protocol uses two channels:

  • Data channel: Raw bytes, no framing (stdin→server, server→stdout)
  • Control channel: JSON messages for out-of-band communication

Structs§

ClientHello
Client hello message sent during handshake
FileRequest
A file to open with optional line/column position, range, and hover message
ServerHello
Server hello message sent in response to ClientHello
TermSize
Terminal size in columns and rows
VersionMismatch
Version mismatch error response

Enums§

ClientControl
Control messages from client to server
ControlMessage
Wrapper for control channel messages (used for JSON serialization)
ServerControl
Control messages from server to client

Constants§

PROTOCOL_VERSION
Protocol version - must match between client and server

Functions§

read_control_message
Read a JSON control message from a reader
write_control_message
Write a JSON control message to a writer