#include <tcp_server.hpp>
tacopie::tcp_server is the class providing TCP Server features. The tcp_server works entirely asynchronously, waiting for the io_service to notify whenever a new client wished to connect. 
◆ on_new_connection_callback_t
callback called whenever a new client is connecting to the server
Takes as parameter a shared pointer to the tcp_client that wishes to connect Returning true means connection is handled by tcp_client wrapper and nothing will be done by tcp_server. Returning false means connection is handled by tcp_server, will be stored in an internal list and tcp_client disconection_handler overriden. 
 
 
◆ get_clients()
      
        
          | const std::list<std::shared_ptr<tacopie::tcp_client> >& tacopie::tcp_server::get_clients | ( | void |  | ) | const | 
      
 
 
◆ get_io_service()
- Returns
- io service monitoring this tcp connection 
 
 
◆ get_socket() [1/2]
      
        
          | tcp_socket& tacopie::tcp_server::get_socket | ( | void |  | ) |  | 
      
 
 
◆ get_socket() [2/2]
      
        
          | const tcp_socket& tacopie::tcp_server::get_socket | ( | void |  | ) | const | 
      
 
 
◆ is_running()
      
        
          | bool tacopie::tcp_server::is_running | ( | void |  | ) | const | 
      
 
- Returns
- whether the server is currently running or not 
 
 
◆ operator!=()
      
        
          | bool tacopie::tcp_server::operator!= | ( | const tcp_server & | rhs | ) | const | 
      
 
comparison operator
- Returns
- true when the underlying sockets are different (different file descriptor or socket type). 
 
 
◆ operator==()
      
        
          | bool tacopie::tcp_server::operator== | ( | const tcp_server & | rhs | ) | const | 
      
 
comparison operator
- Returns
- true when the underlying sockets are the same (same file descriptor and socket type). 
 
 
◆ start()
Start the tcp_server at the given host and port.
- Parameters
- 
  
    | host | hostname to be connected to |  | port | port to be connected to |  | callback | callback to be called on new connections (may be null, connections are then handled automatically by the tcp_server object) |  
 
 
 
◆ stop()
      
        
          | void tacopie::tcp_server::stop | ( | bool | wait_for_removal = false, | 
        
          |  |  | bool | recursive_wait_for_removal = true | 
        
          |  | ) |  |  | 
      
 
Disconnect the tcp_server if it was currently running.
- Parameters
- 
  
    | wait_for_removal | When sets to true, disconnect blocks until the underlying TCP server has been effectively removed from the io_service and that all the underlying callbacks have completed. |  | recursive_wait_for_removal | When sets to true and wait_for_removal is also set to true, blocks until all the underlying TCP client connected to the TCP server have been effectively removed from the io_service and that all the underlying callbacks have completed. |  
 
 
 
The documentation for this class was generated from the following file: