blob: 6c1e3a8e649eb1c8854d6881ba13ec092e030bbb [file] [log] [blame]
Giulio Grassi624f6c62014-02-18 19:42:14 +01001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#ifndef NFD_FACE_UDP_FACE_HPP
8#define NFD_FACE_UDP_FACE_HPP
9
10#include "datagram-face.hpp"
11
12namespace nfd
13{
14
15/**
16 * \brief Implementation of Face abstraction that uses UDP
17 * as underlying transport mechanism
18 */
19class UdpFace : public DatagramFace<boost::asio::ip::udp>
20{
21public:
22 typedef boost::asio::ip::udp protocol;
23
Giulio Grassi69871f02014-03-09 16:14:44 +010024 UdpFace(const shared_ptr<protocol::socket>& socket,
Alexander Afanasyev355c0662014-03-20 18:08:17 -070025 bool isOnDemand);
Giulio Grassi624f6c62014-02-18 19:42:14 +010026
27 //@todo if needed by other datagramFaces, it could be moved to datagram-face.hpp
28 /**
29 * \brief Manages the first datagram received by the UdpChannel socket set on listening
30 */
31 void
32 handleFirstReceive(const uint8_t* buffer,
33 std::size_t nBytesReceived,
34 const boost::system::error_code& error);
35
36};
37
38} // namespace nfd
39
40#endif // NFD_FACE_UDP_FACE_HPP