26 #ifndef NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
33 using Endpoint = boost::asio::ip::tcp::endpoint;
57 return m_server.is_listening();
63 return m_channelFaces.size();
79 setPingInterval(time::milliseconds interval);
84 setPongTimeout(time::milliseconds timeout);
87 handlePong(websocketpp::connection_hdl hdl);
90 handlePongTimeout(websocketpp::connection_hdl hdl);
94 handleMessage(websocketpp::connection_hdl hdl,
95 websocket::Server::message_ptr msg);
98 handleOpen(websocketpp::connection_hdl hdl);
101 handleClose(websocketpp::connection_hdl hdl);
106 std::map<websocketpp::connection_hdl, shared_ptr<Face>,
107 std::owner_less<websocketpp::connection_hdl>> m_channelFaces;
109 time::milliseconds m_pingInterval;
Represents a channel that listens on a local endpoint.
Class implementing WebSocket-based channel to create faces.
bool isListening() const final
Returns whether the channel is listening.
void listen(const FaceCreatedCallback &onFaceCreated)
Enable listening on the local endpoint, accept connections, and create faces when remote host makes a...
WebSocketChannel(const websocket::Endpoint &localEndpoint)
Create WebSocket channel for the local endpoint.
size_t size() const final
Returns the number of faces in the channel.
#define NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE
std::function< void(const shared_ptr< Face > &)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
websocketpp::server< websocketpp::config::asio > Server
boost::asio::ip::tcp::endpoint Endpoint