Skip to main content

Module dc

Module dc 

Source
Expand description

DC (Direct Connect) client implementation

Re-exports§

pub use actions::DcClientProtocol;

Modules§

actions
DC (Direct Connect) client protocol actions implementation

Structs§

DcClient
DC client that connects to a DC hub
PrivateMessageParts
The fields of an NMDC private message.

Constants§

MAX_RECONNECT_DELAY_SECS
Longest wait between two reconnection attempts, in seconds.

Functions§

calculate_dc_key
Calculate DC key from lock using NMDC algorithm
escape_nmdc_text
Escape free text (a chat line, a private message, a search query, a $MyINFO description or email) for an NMDC frame, the way DC++ does: $ becomes $, | becomes |, and a & that would otherwise read as the start of $, | or & becomes &. The text can then neither end the frame nor open a new command, and the hub decodes exactly the characters given.
parse_private_message
Parse an NMDC private message: $To: <target> From: <source> $<<source>> <message>.
reconnect_delay_secs
Delay before reconnection attempt attempt (1-based): initial_delay_secs doubled for every attempt after the first, capped at MAX_RECONNECT_DELAY_SECS.
validate_nmdc_nickname
Check a nickname before it is written into $ValidateNick, $MyINFO, a chat prefix or a $To: line.