forked from securesocketfunneling/udt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
udt.h
40 lines (30 loc) · 1.27 KB
/
udt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef UDT_IP_UDT_H_
#define UDT_IP_UDT_H_
#include <boost/asio/ip/udp.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/detail/socket_types.hpp>
#include "udt/connected_protocol/protocol.h"
#include "udt/connected_protocol/logger/no_log.h"
#include "udt/connected_protocol/congestion/congestion_control.h"
#include "udt/ip/udt_resolver.h"
namespace ip {
template <class Logger = connected_protocol::logger::NoLog,
template <class> class CongestionControlAlg =
connected_protocol::congestion::CongestionControl>
class udt {
public:
using protocol_type = connected_protocol::Protocol<boost::asio::ip::udp, Logger,
CongestionControlAlg>;
using endpoint = typename protocol_type::endpoint;
using socket = typename protocol_type::socket;
using resolver = UDTResolver<protocol_type>;
using acceptor = typename protocol_type::acceptor;
/// Obtain an identifier for the type of the protocol.
int type() const { return BOOST_ASIO_OS_DEF(SOCK_STREAM); }
/// Obtain an identifier for the protocol.
int protocol() const { return BOOST_ASIO_OS_DEF(IPPROTO_IP); }
/// Obtain an identifier for the protocol family.
int family() const { return BOOST_ASIO_OS_DEF(AF_INET); }
};
} // ip
#endif // UDT_IP_UDT_H_