Discussion:
[libtorrent] utp_stream example
dave m.
2016-03-08 05:07:20 UTC
Permalink
Hi, I'm using libtorrent to learn about BT and DHT. My next project
is to speak uTP to a peer, so I'd like to use utp_stream & friends.
However, I can't find any docs or example code, and my attempts to
replace boost::asio::ip::tcp::socket with libtorrent::utp_stream
haven't worked (I think I have to set an implementation somehow, but I
don't understand how to do it). So, a couple of questions:

* Can a libtorrent-based program make outbound uTP connections, or is
it mostly designed to promote existing / inbound UDP connections to
uTP?

* Is there any sample code or beta docs or anything on how to use
utp_stream & friends?

Thanks!
dhm.
Arvid Norberg
2016-03-15 05:45:36 UTC
Permalink
Post by dave m.
Hi, I'm using libtorrent to learn about BT and DHT. My next project
is to speak uTP to a peer, so I'd like to use utp_stream & friends.
However, I can't find any docs or example code, and my attempts to
replace boost::asio::ip::tcp::socket with libtorrent::utp_stream
haven't worked (I think I have to set an implementation somehow, but I
* Can a libtorrent-based program make outbound uTP connections, or is
it mostly designed to promote existing / inbound UDP connections to
uTP?
* Is there any sample code or beta docs or anything on how to use
utp_stream & friends?
It's designed as part of the libtorrent implementation. There's no public
API exported from libtorrent to open arbitrary uTP connections. The only
documentation of it is in the comments. utp_stream needs a
utp_socket_manager, which needs a udp_socket and to be ticked regularly.
--
Arvid Norberg
Post by dave m.
Hi, I'm using libtorrent to learn about BT and DHT. My next project
is to speak uTP to a peer, so I'd like to use utp_stream & friends.
However, I can't find any docs or example code, and my attempts to
replace boost::asio::ip::tcp::socket with libtorrent::utp_stream
haven't worked (I think I have to set an implementation somehow, but I
* Can a libtorrent-based program make outbound uTP connections, or is
it mostly designed to promote existing / inbound UDP connections to
uTP?
* Is there any sample code or beta docs or anything on how to use
utp_stream & friends?
Thanks!
dhm.
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Libtorrent-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/libtorrent-discuss
--
Arvid Norberg
dave m.
2016-03-15 16:05:43 UTC
Permalink
Post by Arvid Norberg
It's designed as part of the libtorrent implementation. There's no public
API exported from libtorrent to open arbitrary uTP connections. The only
documentation of it is in the comments. utp_stream needs a
utp_socket_manager, which needs a udp_socket and to be ticked regularly.
OK thanks! I guess I'll have to dig into that. Does the socket manager
handle sorting out packets from different sender/port all going to a
single local socket/port? I assume so, since otherwise you'd have to
have separate local sockets, or you could only speak uTP to one peer at
a time...

Regards,
dhm.
Arvid Norberg
2016-03-15 21:51:08 UTC
Permalink
Post by dave m.
Post by Arvid Norberg
It's designed as part of the libtorrent implementation. There's no public
API exported from libtorrent to open arbitrary uTP connections. The only
documentation of it is in the comments. utp_stream needs a
utp_socket_manager, which needs a udp_socket and to be ticked regularly.
OK thanks! I guess I'll have to dig into that. Does the socket manager
handle sorting out packets from different sender/port all going to a
single local socket/port? I assume so, since otherwise you'd have to
have separate local sockets, or you could only speak uTP to one peer at
a time...
yes, that's right.
--
Arvid Norberg
Continue reading on narkive:
Loading...