Contains the common part of TCP and UDP Receiver. This class manage the io_service thread, and the onNewDataReceived method. In both cases (UDP or TCP), we do the same thing when new data are received : More...
#include <ip_listener.h>
Public Member Functions | |
IPListener (const std::string &ip, uint16_t port) | |
void | onNewDataReceived (const boost::system::error_code &error, std::size_t bytes_transfered) |
virtual | ~IPListener () |
Protected Member Functions | |
virtual void | listenNextData (void)=0 |
Protected Attributes | |
std::thread | asioThread |
boost::array< uint8_t, 8192 > | datas |
const std::string | ip |
ixblue_stdbin_decoder::StdBinDecoder | parser |
const uint16_t | port |
ROSPublisher | rosPublisher |
boost::asio::io_service | service |
Private Member Functions | |
IPListener ()=delete | |
Contains the common part of TCP and UDP Receiver. This class manage the io_service thread, and the onNewDataReceived method. In both cases (UDP or TCP), we do the same thing when new data are received :
Definition at line 22 of file ip_listener.h.
|
privatedelete |
IPListener::IPListener | ( | const std::string & | ip, |
uint16_t | port | ||
) |
Definition at line 6 of file ip_listener.cpp.
|
virtual |
Definition at line 8 of file ip_listener.cpp.
|
protectedpure virtual |
This is the pro-actor pattern implemented by boost asio. Each daughter class must use this abstract method to listen next data.
Implemented in UDPListener.
void IPListener::onNewDataReceived | ( | const boost::system::error_code & | error, |
std::size_t | bytes_transfered | ||
) |
Definition at line 14 of file ip_listener.cpp.
|
protected |
Definition at line 46 of file ip_listener.h.
|
protected |
Definition at line 44 of file ip_listener.h.
|
protected |
Definition at line 39 of file ip_listener.h.
|
protected |
Definition at line 42 of file ip_listener.h.
|
protected |
Definition at line 40 of file ip_listener.h.
|
protected |
Definition at line 47 of file ip_listener.h.
|
protected |
Definition at line 45 of file ip_listener.h.