Boost.Asio wrapper over uTorrent's uTP library
BSL-1.0 License
Similar API to the TCP sockets in Asio. In particular, the utp::socket
implements the AsyncReadStream
and AsyncWriteStream
requirements.
Making it readily usable with Asio's free functions or classes utilizing those
requirements. Such as async_read
, async_write
, ssl::stream
, ...
Also similar to Asio's TCP sockets, utp::socket
's async
API supports
callbacks, futures and coroutines as completion tokens.
The asio_utp::udp_multiplexer
can be used to perform non uTP sending and
receiving of UDP datagrams.
asio-utp
git repository contains libutp
(the uTorrents uTP library written in C)
as a submodule. Thus one has to clone it recursively:
git clone --recursive [email protected]:inetic/asio-utp.git
cd asio-utp
mkdir build
cd build
cmake .. -DBOOST_ROOT=<PATH_TO_BOOST_DIRECTORY>
make -j$(nproc)
For more detailed instructions, have a look at the .circleci/config.yml
file.
libutp/utp_internals.c
, but those seem to be onlysocket::async_connect
simply executes the underlyinglibutp/utp_connect
function. The latter sends one SYN packet but does notsocket::async_connect
. asio_utp::socket --- asio_utp::socket_impl ---+
\
asio_utp::socket --- asio_utp::socket_impl -----+--- asio_utp::context
/ \
asio_utp::socket --- asio_utp::socket_impl ---+ \
\
+----------- asio_utp::udp_multiplexer_impl
asio_utp::udp_multiplexer ---+ / \
\ / \
asio_utp::udp_multiplexer -----+---+ asio::udp::socket
/
asio_utp::udp_multiplexer ---+