26 #ifndef NFD_DAEMON_FACE_TCP_CHANNEL_HPP 27 #define NFD_DAEMON_FACE_TCP_CHANNEL_HPP 35 typedef boost::asio::ip::tcp::endpoint
Endpoint;
61 return m_acceptor.is_open();
67 return m_channelFaces.size();
82 int backlog = boost::asio::ip::tcp::acceptor::max_connections);
92 time::nanoseconds timeout = 8_s);
96 createFace(boost::asio::ip::tcp::socket&& socket,
105 handleAccept(
const boost::system::error_code& error,
110 handleConnect(
const boost::system::error_code& error,
112 const shared_ptr<boost::asio::ip::tcp::socket>& socket,
120 const shared_ptr<boost::asio::ip::tcp::socket>& socket,
125 boost::asio::ip::tcp::acceptor m_acceptor;
126 boost::asio::ip::tcp::socket m_socket;
127 std::map<tcp::Endpoint, shared_ptr<Face>> m_channelFaces;
128 bool m_wantCongestionMarking;
134 #endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP TcpChannel(const tcp::Endpoint &localEndpoint, bool wantCongestionMarking)
Create TCP channel for the local endpoint.
represent a channel that communicates on a local endpoint
bool isListening() const override
Returns whether the channel is listening.
function< void(const shared_ptr< Face > &face)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
void listen(const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onAcceptFailed, int backlog=boost::asio::ip::tcp::acceptor::max_connections)
Enable listening on the local endpoint, accept connections, and create faces when remote host makes a...
size_t size() const override
Returns the number of faces in the channel.
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
std::shared_ptr< ns3::EventId > EventId
Parameters used to set Transport properties or LinkService options on a newly created face...
Copyright (c) 2011-2015 Regents of the University of California.
boost::asio::ip::tcp::endpoint Endpoint
void connect(const tcp::Endpoint &remoteEndpoint, const FaceParams ¶ms, const FaceCreatedCallback &onFaceCreated, const FaceCreationFailedCallback &onConnectFailed, time::nanoseconds timeout=8_s)
Create a face by establishing a TCP connection to remoteEndpoint.
Class implementing TCP-based channel to create faces.