• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

pyutp/H03-May-2022-2,4231,817

tests/H03-May-2022-914797

utp_config_lib/H03-May-2022-3823

utp_file/H03-May-2022-1,7141,525

utp_test/H03-May-2022-1,034888

LICENSEH A D03-May-20221 KiB2016

MakefileH A D03-May-2022302 1913

README.mdH A D03-May-20222.4 KiB6745

StdAfx.hH A D03-May-2022462 126

parse_log.pyH A D03-May-20227.8 KiB289213

templates.hH A D03-May-20225 KiB187137

utp.cppH A D03-May-202286.9 KiB2,8681,839

utp.defH A D03-May-2022349 1615

utp.hH A D03-May-20225.7 KiB16681

utp.slnH A D03-May-20222 KiB3937

utp.vcprojH A D03-May-202212 KiB634633

utp_config_example.hH A D03-May-2022708 2721

utp_utils.cppH A D03-May-20225.9 KiB211151

utp_utils.hH A D03-May-2022889 177

utypes.hH A D03-May-2022834 4532

win32_inet_ntop.cppH A D03-May-20222 KiB8673

win32_inet_ntop.hH A D03-May-2022294 107

README.md

1# libutp - The uTorrent Transport Protocol library.
2Copyright (c) 2010 BitTorrent, Inc.
3
4uTP is a TCP-like implementation of [LEDBAT][ledbat] documented as a BitTorrent
5extension in [BEP-29][bep29]. uTP provides provides reliable, ordered delivery
6while maintaining minimum extra delay. It is implemented on top of UDP to be
7cross-platform and functional today. As a result, uTP is the primary transport
8for uTorrent peer-to-peer connections.
9
10uTP is written in C++, but the external interface is strictly C (ANSI C89).
11
12## The Interface
13
14The uTP socket interface is a bit different from the Berkeley socket API to
15avoid the need for our own select() implementation, and to make it easier to
16write event-based code with minimal buffering.
17
18When you create a uTP socket, you register a set of callbacks. Most notably, the
19on_read callback is a reactive callback which occurs when bytes arrive off the
20network. The write side of the socket is proactive, and you call UTP_Write to
21indicate the number of bytes you wish to write. As packets are created, the
22on_write callback is called for each packet, so you can fill the buffers with
23data.
24
25The libutp interface is not thread-safe. It was designed for use in a
26single-threaded asyncronous context, although with proper synchronization
27it may be used from a multi-threaded environment as well.
28
29See utp.h for more details and other API documentation.
30
31## Examples
32
33See the utp_test and utp_file directories for examples.
34
35## Building
36
37uTP has been known to build on Windows with MSVC and on linux and OS X with gcc.
38On Windows, use the MSVC project files (utp.sln, and friends). On other platforms,
39building the shared library is as simple as:
40
41    make
42
43To build one of the examples, which will statically link in everything it needs
44from libutp:
45
46    cd utp_test && make
47
48## Packaging and API
49
50The libutp API is considered unstable, and probably always will be. We encourage
51you to test with the version of libutp you have, and be mindful when upgrading.
52For this reason, it is probably also a good idea to bundle libutp with your
53application.
54
55## License
56
57libutp is released under the [MIT][lic] license.
58
59## Related Work
60
61Research and analysis of congestion control mechanisms can be found [here.][survey]
62
63[ledbat]: http://datatracker.ietf.org/wg/ledbat/charter/
64[bep29]: http://www.bittorrent.org/beps/bep_0029.html
65[lic]: http://www.opensource.org/licenses/mit-license.php
66[survey]: http://datatracker.ietf.org/doc/draft-ietf-ledbat-survey/
67