NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
unix-stream-transport.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
27 
28 namespace nfd {
29 namespace face {
30 
32  "UnixStreamTransport");
33 
34 UnixStreamTransport::UnixStreamTransport(protocol::socket&& socket)
35  : StreamTransport(std::move(socket))
36 {
37  static_assert(
38  std::is_same<std::remove_cv<protocol::socket::native_handle_type>::type, int>::value,
39  "The native handle type for UnixStreamTransport sockets must be 'int'"
40  );
41 
42  this->setLocalUri(FaceUri(m_socket.local_endpoint()));
43  this->setRemoteUri(FaceUri::fromFd(m_socket.native_handle()));
47  this->setMtu(MTU_UNLIMITED);
48 
49  NFD_LOG_FACE_INFO("Creating transport");
50 }
51 
52 } // namespace face
53 } // namespace nfd
void setPersistency(ndn::nfd::FacePersistency newPersistency)
changes face persistency setting
Definition: transport.cpp:158
static FaceUri fromFd(int fd)
create fd FaceUri from file descriptor
Definition: face-uri.cpp:154
#define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name)
Definition: logger.hpp:46
const ssize_t MTU_UNLIMITED
indicates the transport has no limit on payload size
Definition: transport.hpp:96
void setRemoteUri(const FaceUri &uri)
Definition: transport.hpp:423
STL namespace.
void setLinkType(ndn::nfd::LinkType linkType)
Definition: transport.hpp:453
void setMtu(ssize_t mtu)
Definition: transport.hpp:465
Implements Transport for stream-based protocols.
void setScope(ndn::nfd::FaceScope scope)
Definition: transport.hpp:435
#define NFD_LOG_FACE_INFO(msg)
Log a message at INFO level.
Definition: face-log.hpp:85
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
void setLocalUri(const FaceUri &uri)
Definition: transport.hpp:411
UnixStreamTransport(protocol::socket &&socket)
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44