Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 1 | /* -*- 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 Pesavento | d8d4d98 | 2014-03-21 18:47:58 +0100 | [diff] [blame^] | 12 | namespace nfd { |
Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 13 | |
| 14 | /** |
| 15 | * \brief Implementation of Face abstraction that uses UDP |
| 16 | * as underlying transport mechanism |
| 17 | */ |
| 18 | class UdpFace : public DatagramFace<boost::asio::ip::udp> |
| 19 | { |
| 20 | public: |
Giulio Grassi | 69871f0 | 2014-03-09 16:14:44 +0100 | [diff] [blame] | 21 | UdpFace(const shared_ptr<protocol::socket>& socket, |
Alexander Afanasyev | 355c066 | 2014-03-20 18:08:17 -0700 | [diff] [blame] | 22 | bool isOnDemand); |
Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 23 | |
Giulio Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 24 | /** |
| 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 Grassi | 624f6c6 | 2014-02-18 19:42:14 +0100 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | } // namespace nfd |
| 34 | |
| 35 | #endif // NFD_FACE_UDP_FACE_HPP |