Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
broadcast_server.cpp File Reference
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <iostream>
#include <set>
#include <websocketpp/common/thread.hpp>
Include dependency graph for broadcast_server.cpp:

Go to the source code of this file.

Classes

struct  action
 
class  broadcast_server
 

Typedefs

typedef websocketpp::server< websocketpp::config::asioserver
 

Enumerations

enum  action_type { SUBSCRIBE , UNSUBSCRIBE , MESSAGE }
 

Functions

int main ()
 

Typedef Documentation

◆ server

Enumeration Type Documentation

◆ action_type

Enumerator
SUBSCRIBE 
UNSUBSCRIBE 
MESSAGE 

Definition at line 31 of file broadcast_server.cpp.

31 {
35};
@ UNSUBSCRIBE
@ MESSAGE
@ SUBSCRIBE

Function Documentation

◆ main()

int main ( void )

Definition at line 145 of file broadcast_server.cpp.

145 {
146 try {
147 broadcast_server server_instance;
148
149 // Start a thread to run the processing loop
150 thread t(bind(&broadcast_server::process_messages,&server_instance));
151
152 // Run the asio loop with the main thread
153 server_instance.run(9002);
154
155 t.join();
156
157 } catch (websocketpp::exception const & e) {
158 std::cout << e.what() << std::endl;
159 }
160}
void run(uint16_t port)
virtual char const * what() const
Definition error.hpp:263
Here is the call graph for this function: