added some precautionary checks in bdecoder
[libtorrent.git] / docs / client_test.html
blob89cde74fe13a491ab00ff19eee4a1e8435418ae7
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
7 <title>client_test example program</title>
8 <link rel="stylesheet" href="style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="client-test-example-program">
12 <h1 class="title">client_test example program</h1>
14 <p>Client test is a, more or less, complete bittorrent client. It lacks most
15 settings and you can't start or stop torrents once you've started it. All
16 the settings are hardcoded. The commandline arguments are:</p>
17 <pre class="literal-block">
18 client_test &lt;filename1.torrent&gt; &lt;filename2.torrent&gt; ...
19 </pre>
20 <p>You can start any number of torrent downloads/seeds via the commandline.
21 If one argument starts with <tt class="docutils literal"><span class="pre">http://</span></tt> it is interpreted as a tracker
22 announce url, and it expects an info-hash as the next argument. The info-hash
23 has to be hex-encoded. For example: <tt class="docutils literal"><span class="pre">2410d4554d5ed856d69f426c38791673c59f4418</span></tt>.
24 If you pass an announce url and info-hash, a torrent-less download is started.
25 It relies on that at least one peer on the tracker is running a libtorrent based
26 client and has the metadata (.torrent file). The metadata extension in
27 libtorrent will then download it from that peer (or from those peers if more
28 than one).</p>
29 <p>While running, the <tt class="docutils literal"><span class="pre">client_test</span></tt> sample will look something like this:</p>
30 <img alt="client_test.png" src="client_test.png" />
31 <p>The commands available in the client are:</p>
32 <ul class="simple">
33 <li><tt class="docutils literal"><span class="pre">q</span></tt> quits the client (there will be a delay while the client waits
34 for tracker responses)</li>
35 <li><tt class="docutils literal"><span class="pre">l</span></tt> toggle log. Will display the log at the bottom, informing about
36 tracker and peer events.</li>
37 <li><tt class="docutils literal"><span class="pre">i</span></tt> toggles torrent info. Will show the peer list for each torrent.</li>
38 <li><tt class="docutils literal"><span class="pre">d</span></tt> toggle download info. Will show the block list for each torrent,
39 showing downloaded and requested blocks.</li>
40 <li><tt class="docutils literal"><span class="pre">p</span></tt> pause all torrents.</li>
41 <li><tt class="docutils literal"><span class="pre">u</span></tt> unpause all torrents.</li>
42 <li><tt class="docutils literal"><span class="pre">r</span></tt> force tracker reannounce for all torrents.</li>
43 <li><tt class="docutils literal"><span class="pre">f</span></tt> toggle show file progress. Displays a list of all files and the
44 download progress for each file.</li>
45 </ul>
46 <p>The list at the bottom (shown if you press <tt class="docutils literal"><span class="pre">d</span></tt>) shows which blocks has
47 been requested from which peer. The green background means that it has been
48 downloaded. It shows that fast peers will prefer to request whole pieces
49 instead of dowloading parts of pieces. It may make it easier to determine
50 which peer that sent the corrupt data if a piece fails the hash test.</p>
51 <img alt="unicode_support.png" src="unicode_support.png" />
52 <p>There's unicode support on linux, MacOS X and Windows.</p>
53 </div>
54 </body>
55 </html>