Note the following when interpreting this specification:
AUTH,
CTBW,
CTCONFIG,
CTCONFIGDONE,
CTCONFIGSTART,
CTDETAIL,
CTFILE,
CTFILESDONE,
CTFILESTART,
CTINFO,
CTORRENT,
CTSTATUS,
CTPEER,
CTPEERSDONE,
CTPEERSTART,
PROTOCOL
CTFDONE,
CTFILES,
CTPDONE,
CTPEERS
Server-originated:
CTCONFIG,
CTQUIT,
CTRESTART,
CTUPDATE,
ERROR,
PROTOCOL,
SENDCONF,
SENDDETAIL,
SENDPEERS,
SENDSTATUS,
SETDLIMIT,
SETULIMIT
Client (CTorrent) | Server (CTCS) |
PROTOCOL
| PROTOCOL |
AUTH (possibly) | |
ERROR (possibly) | |
CTORRENT | |
CTSTATUS | |
SETDLIMIT | |
SETULIMIT | |
CTBW | |
... | |
SENDSTATUS | |
CTSTATUS | |
... | |
SENDDETAIL | |
CTDETAIL | |
CTFILESTART | |
CTFILE (multiple) | |
CTFILESDONE | |
... | |
SENDPEERS | |
CTPEERSTART | |
CTPEER (multiple) | |
CTPEERSDONE | |
... | |
SENDCONF | |
CTCONFIGSTART | |
CTCONFIG
(multiple) | |
CTCONFIGDONE | |
CTCONFIG
(with changes) |
PROTOCOL versionUpon connection, this message is sent by both the client and the server to indicate the CTCS protocol version that each supports. The information should be used to format message parameters appropriately for the other side and to recognize that newer messages will not be recognized (and should be avoided if possible). This should be the first message sent when the connection is established. It may be sent again with a different version confirming a "negotiation down" of the protocol version that will be used, but this is not required.
version
AUTH passwordIf authentication is used, the client sends this message upon connection (after protocol identification).
password
CTORRENT peer_id start_timestamp current_timestamp filenameThe client sends this message upon connection to identify itself to CTCS.
peer_id
start_timestamp
current_timestamp
filename
CTCONFIGSTARTThe client sends this message to indicate that it is sending a list of configuration options. It may be sent in response to a
SENDCONF
message from the server or
independently if something has changed.
This message is followed by a
CTCONFIG
message for each option,
and then by a CTCONFIGDONE
message.
CTCONFIG name type range len:value len:short_desc len:long_descFor previous protocols, see the old format of this message.
The client sends this message as part of a
CTCONFIGSTART
sequence to describe
its entire configuration, or independently to notify of a configuration change.
name
type
I
= integer
F
= floating-point number
B
= binary (value may be 0 or 1)
S
= string
range
x-y
) indicating the acceptable
numeric values of the option, or a single number indicating the maximum
acceptable string length.
len
value
short_desc
long_desc
CTCONFIGDONEThe client sends this message at the end of a
CTCONFIGSTART
sequence to indicate
that the complete list of configuration options has been sent.
Protocol 2:
CTCONFIG verbose seedtime seed_ratio maxpeers minpeers fileno cache_size pauseProtocol 1:
CTCONFIG verbose seedtime seed_ratio maxpeers minpeers fileno exitzero pause soft_quitThe client sends this message in response to a
SENDCONF
message from the server,
or to notify the server of configuration changes.
The server can send this message to change the client's configuration.
The server can use a dot (".") in any parameter position to leave that
setting as it is.
verbose
seedtime
seed_ratio
maxpeers
minpeers
fileno
exitzero
cache_size
pause
soft_quit
CTBW dl_rate,ul_rate dl_limit,ul_limitThe client sends this message periodically (unsolicited) to report its current transfer rates and limits. The client should send this message whenever the download or upload rate changes.
dl_rate
ul_rate
dl_limit
ul_limit
CTINFO severity messageThe client can send this message to report errors or general status information.
severity
message
CTSTATUS seeders:total_seeders/leechers:total_leechers/connecting n_have/n_total/n_avail dl_rate,ul_rate dl_total,ul_total dl_limit,ul_limit cache_usedProtocol 1:
CTSTATUS seeders/leechers n_have/n_total/n_avail dl_rate,ul_rate dl_total,ul_total dl_limit,ul_limitThe client sends this message in response to a
SENDSTATUS
message from the server. The
information is typical of what might be included in a client's status display.
It can also be sent unsolicited in place of a
CTBW
message to provide an initial status or
to communicate important changes (such as completion of the torrent).
seeders
total_seeders
leechers
total_leechers
connecting
n_have
n_total
n_avail
dl_rate
ul_rate
dl_total
ul_total
dl_limit
ul_limit
cache_used
CTPEERSTARTProtocol 1:
CTPEERSThe client sends this message in response to a
SENDPEERS
message from the server. It
tells the server that the client is beginning to send a list of its peers.
This message is followed by a CTPEER
message for each peer (if the client has any), and then by a
CTPEERSDONE
message.
CTPEER peer_id address choke_interest dl_rate ul_rate dl_total ul_total n_piecesThe client sends this message as part of a
CTPEERSTART
sequence. The message
reports the details of one peer.
peer_id
address
choke_interest
dl_rate
ul_rate
dl_total
ul_total
n_pieces
CTPEERSDONEProtocol 1:
CTPDONEThe client sends this message at the end of a
CTPEERSTART
sequence to indicate that the complete list of peers has been sent.
CTDETAIL torrent_size piece_size current_timestamp seed_timestampThe client sends this message in response to a
SENDDETAIL
message from the server to
report information related to ratios and seed time.
This may also be followed by a
CTFILESTART
sequence.
torrent_size
piece_size
current_timestamp
seed_timestamp
CTFILESTARTProtocol 1:
CTFILESThe client may send this message following a
CTDETAIL
response. It tells the server that the client is beginning to send a list
of the torrent files. This message is followed by a
CTFILE
message for each file, and
then by a CTFILESDONE
message.
CTFILE fileno priority current_priority n_pieces n_have n_available filesize filenameProtocol 2:
CTFILE fileno n_pieces n_have n_available filesize filenameProtocol 1:
CTFILE fileno n_pieces n_have filesize filenameThe client sends this message as part of a
CTFILESTART
sequence. The message reports the details of one file.
fileno
priority
current_priority
n_pieces
n_have
n_available
filesize
filename
CTFILESDONEProtocol 1:
CTFDONEThe client sends this message at the end of a
CTFILESTART
sequence to indicate that the complete list of files has been sent.
PROTOCOL versionThis message is identical to the client-originated
PROTOCOL
message.
CTCONFIG name valueFor previous protocols, see the old format of this message.
The server sends this message to the client to change a configuration option.
name
value
Protocol 2:
CTCONFIG verbose seedtime seed_ratio maxpeers minpeers fileno cache_size pauseProtocol 1:
CTCONFIG verbose seedtime seed_ratio maxpeers minpeers fileno exitzero pause soft_quitThis message is identical to the client-originated
CTCONFIG
message.
ERROR messageThe server can send this message to report an error to the client. This would normally be used for CTCS issues such as authentication; the client would display the message in its console window.
message
CTQUITThe server can send this message to tell the client to exit gracefully (it will attempt to update the tracker).
CTRESTARTThe server can send this message to tell the client to restart its tracker session. The client will de-register with the tracker, then re-register with the tracker as a new peer.
CTUPDATEThe server can send this message to tell the client to update statistics with the tracker and try to obtain more peers.
SETDLIMIT dl_limitThe server can send this message to change the client's download limit.
dl_limit
SETULIMIT ul_limitThe server can send this message to change the client's upload limit.
ul_limit
SENDSTATUSThe server can send this message to request the client to report detailed status information. The client responds with a
CTSTATUS
message.
SENDPEERSThe server can send this message to request the client to report detailed information about its connected peers. The client responds with a
CTPEERS
message sequence.
SENDDETAILThe server can send this message to request the client to report detailed torrent information. The client responds with a
CTDETAIL
message.
SENDCONFThe server can send this message to request the client to report its current configuration. The client responds with a
CTCONFIG
message.