26 #ifndef NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
27 #define NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
35 typedef boost::asio::ip::tcp::endpoint
Endpoint;
59 return m_server.is_listening();
65 return m_channelFaces.size();
81 setPingInterval(time::milliseconds interval);
86 setPongTimeout(time::milliseconds timeout);
89 handlePong(websocketpp::connection_hdl hdl);
92 handlePongTimeout(websocketpp::connection_hdl hdl);
96 handleMessage(websocketpp::connection_hdl hdl,
97 websocket::Server::message_ptr msg);
100 handleOpen(websocketpp::connection_hdl hdl);
103 handleClose(websocketpp::connection_hdl hdl);
108 std::map<websocketpp::connection_hdl, shared_ptr<Face>,
109 std::owner_less<websocketpp::connection_hdl>> m_channelFaces;
111 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...
boost::asio::ip::tcp::endpoint Endpoint
websocketpp::server< websocketpp::config::asio > Server
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...