NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
print_server.cpp
Go to the documentation of this file.
1 #include <iostream>
2 
4 #include <websocketpp/server.hpp>
5 
7 
9  std::cout << msg->get_payload() << std::endl;
10 }
11 
12 int main() {
14 
15  print_server.set_message_handler(&on_message);
18 
19  print_server.init_asio();
20  print_server.listen(9002);
21  print_server.start_accept();
22 
23  print_server.run();
24 }
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:152
connection_type::message_ptr message_ptr
Type of message pointers that this endpoint uses.
Definition: endpoint.hpp:70
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
void init_asio(io_service_ptr ptr, lib::error_code &ec)
initialize asio transport with external io_service (exception free)
Definition: endpoint.hpp:181
void start_accept(lib::error_code &ec)
Starts the server&#39;s async connection acceptance loop (exception free)
void set_access_channels(log::level channels)
Set Access logging channel.
Definition: endpoint.hpp:220
void set_error_channels(log::level channels)
Set Error logging channel.
Definition: endpoint.hpp:242
std::size_t run()
wraps the run method of the internal io_service object
Definition: endpoint.hpp:613
void listen(lib::asio::ip::tcp::endpoint const &ep, lib::error_code &ec)
Set up endpoint for listening manually (exception free)
Definition: endpoint.hpp:391
void set_message_handler(message_handler h)
Definition: endpoint.hpp:322
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:80