Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
Protocol Constants

Core protocol version and configuration constants. More...

Variables

static const int16_t kProtocolMajorVersion = 1
 Protocol major version number.
static const int16_t kProtocolMinorVersion = 8
 Protocol minor version number.
static const uint16_t kDefaultPort = 24800
 Default TCP port for Deskflow connections.
static const uint32_t kMaxHelloLength = 1024
 Maximum length for client greeting message.
static const double kKeepAliveRate = 3.0
 Keep-alive message interval in seconds.
static const double kKeepAlivesUntilDeath = 3.0
 Keep-alive timeout threshold.
static const double kHeartRate = -1.0
 Obsolete heartbeat rate (deprecated)
static const double kHeartBeatsUntilDeath = 3.0
 Obsolete heartbeat timeout (deprecated)
static constexpr uint32_t PROTOCOL_MAX_MESSAGE_LENGTH = 4 * 1024 * 1024
 Maximum allowed message length.
static constexpr uint32_t PROTOCOL_MAX_LIST_LENGTH = 1024 * 1024
 Maximum allowed list length in protocol messages.
static constexpr uint32_t PROTOCOL_MAX_STRING_LENGTH = 1024 * 1024
 Maximum allowed string length in protocol messages.

Detailed Description

Core protocol version and configuration constants.

Variable Documentation

◆ kDefaultPort

const uint16_t kDefaultPort = 24800
static

Default TCP port for Deskflow connections.

Clients connect to this port on the server by default. Can be overridden in configuration.

Since
Protocol version 1.0

◆ kHeartBeatsUntilDeath

const double kHeartBeatsUntilDeath = 3.0
static

Obsolete heartbeat timeout (deprecated)

Deprecated
Since protocol version 1.3, replaced by keep-alive mechanism
See also
kKeepAlivesUntilDeath

◆ kHeartRate

const double kHeartRate = -1.0
static

Obsolete heartbeat rate (deprecated)

Deprecated
Since protocol version 1.3, replaced by keep-alive mechanism
See also
kKeepAliveRate

◆ kKeepAliveRate

const double kKeepAliveRate = 3.0
static

Keep-alive message interval in seconds.

Time between kMsgCKeepAlive messages sent by the server. A non-positive value disables keep-alives. This is the default rate that can be overridden using options.

See also
kMsgCKeepAlive
Since
Protocol version 1.3

◆ kKeepAlivesUntilDeath

const double kKeepAlivesUntilDeath = 3.0
static

Keep-alive timeout threshold.

Number of consecutive missed kMsgCKeepAlive messages that indicates a connection problem. After this many missed messages, the connection is considered dead and will be terminated.

See also
kMsgCKeepAlive
Since
Protocol version 1.3

◆ kMaxHelloLength

const uint32_t kMaxHelloLength = 1024
static

Maximum length for client greeting message.

Limits the size of the hello message sent by clients during handshake. Prevents memory exhaustion attacks during connection establishment.

Since
Protocol version 1.0

◆ kProtocolMajorVersion

const int16_t kProtocolMajorVersion = 1
static

Protocol major version number.

The major version indicates fundamental protocol compatibility. Clients and servers with different major versions cannot communicate.

Since
Protocol version 1.0

◆ kProtocolMinorVersion

const int16_t kProtocolMinorVersion = 8
static

Protocol minor version number.

The minor version indicates feature availability within the same major version. Higher minor versions are backward compatible with lower minor versions.

Note
When incrementing the minor version, the Deskflow application version should also increment
Since
Protocol version 1.0

◆ PROTOCOL_MAX_LIST_LENGTH

uint32_t PROTOCOL_MAX_LIST_LENGTH = 1024 * 1024
staticconstexpr

Maximum allowed list length in protocol messages.

Limits the size of lists (arrays) in protocol messages to prevent memory exhaustion attacks.

Since
Protocol version 1.0

◆ PROTOCOL_MAX_MESSAGE_LENGTH

uint32_t PROTOCOL_MAX_MESSAGE_LENGTH = 4 * 1024 * 1024
staticconstexpr

Maximum allowed message length.

Messages exceeding this size indicate a likely protocol error. Such messages are not parsed and cause connection termination. This prevents memory exhaustion attacks.

Note
Clipboard messages are separately limited to 32KB chunks
Since
Protocol version 1.0

◆ PROTOCOL_MAX_STRING_LENGTH

uint32_t PROTOCOL_MAX_STRING_LENGTH = 1024 * 1024
staticconstexpr

Maximum allowed string length in protocol messages.

Limits the size of strings in protocol messages to prevent memory exhaustion attacks.

Since
Protocol version 1.0