26 #ifndef NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
35 using Endpoint = boost::asio::ip::tcp::endpoint;
58 return m_server.is_listening();
64 return m_channelFaces.size();
81 setPingInterval(time::milliseconds interval);
87 setPongTimeout(time::milliseconds timeout);
90 handlePong(websocketpp::connection_hdl hdl);
93 handlePongTimeout(websocketpp::connection_hdl hdl);
97 handleMessage(websocketpp::connection_hdl hdl,
98 websocket::Server::message_ptr msg);
101 handleOpen(websocketpp::connection_hdl hdl);
104 handleClose(websocketpp::connection_hdl hdl);
109 std::map<websocketpp::connection_hdl, shared_ptr<Face>,
110 std::owner_less<websocketpp::connection_hdl>> m_channelFaces;
112 time::milliseconds m_pingInterval;
Represents a channel that listens on a local endpoint.
Class implementing a 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 a WebSocket channel for the given localEndpoint.
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