blob: 4e882c0af493a3a112f2f4392c897e7f3eb9ed0d [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
Davide Pesaventod8d4d982014-03-21 18:47:58 +010012namespace nfd {
Giulio Grassi624f6c62014-02-18 19:42:14 +010013
14/**
15 * \brief Implementation of Face abstraction that uses UDP
16 * as underlying transport mechanism
17 */
18class UdpFace : public DatagramFace<boost::asio::ip::udp>
19{
20public:
Giulio Grassi69871f02014-03-09 16:14:44 +010021 UdpFace(const shared_ptr<protocol::socket>& socket,
Alexander Afanasyev355c0662014-03-20 18:08:17 -070022 bool isOnDemand);
Giulio Grassi624f6c62014-02-18 19:42:14 +010023
Giulio Grassi624f6c62014-02-18 19:42:14 +010024 /**
25 * \brief Manages the first datagram received by the UdpChannel socket set on listening
26 */
27 void
28 handleFirstReceive(const uint8_t* buffer,
29 std::size_t nBytesReceived,
30 const boost::system::error_code& error);
Giulio Grassi624f6c62014-02-18 19:42:14 +010031};
32
33} // namespace nfd
34
35#endif // NFD_FACE_UDP_FACE_HPP