32 shared_ptr<WebSocketChannel>
35 auto channel = findChannel(endpoint);
39 channel = make_shared<WebSocketChannel>(endpoint);
40 m_channels[endpoint] = channel;
45 shared_ptr<WebSocketChannel>
49 boost::lexical_cast<uint16_t>(localPort));
56 bool wantLocalFieldsEnabled,
60 onFailure(406,
"Unsupported protocol");
63 std::vector<shared_ptr<const Channel>>
66 std::vector<shared_ptr<const Channel>> channels;
67 channels.reserve(m_channels.size());
69 for (
const auto& i : m_channels)
70 channels.push_back(i.second);
75 shared_ptr<WebSocketChannel>
78 auto i = m_channels.find(endpoint);
79 if (i != m_channels.end())
virtual std::vector< shared_ptr< const Channel > > getChannels() const override
represents the underlying protocol and address used by a Face
shared_ptr< WebSocketChannel > createChannel(const websocket::Endpoint &localEndpoint)
Create WebSocket-based channel using websocket::Endpoint.
Copyright (c) 2011-2015 Regents of the University of California.
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
Try to create Face using the supplied FaceUri.
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
boost::asio::ip::tcp::endpoint Endpoint