Basic Image AlgorithmS Library
2.8.0
|
class for receiving UDP packages More...
#include <NetworkComm/UDPClient.hh>
Public Member Functions | |
char * | GetServerAddr () |
void | Init (int port, const char *bind_to_ip=NULL) |
bool | IsActive () |
void | receive_loop () |
int | start (int max_message_size, int number_of_message_buffers, UDPDataConsumer *uc, bool UseTCP=false) |
Start receiving UDP packages. More... | |
void | stop () |
Stop the running client thread. More... | |
UDPClient () | |
~UDPClient () | |
Destructor. More... | |
Protected Member Functions | |
void | check_for_complete_message (int last_number, int frames_total) |
void | create_buffer_structure (unsigned int numbuffers) |
void | destroy_buffer_structure () |
int | get_a_free_buffer () |
Protected Attributes | |
std::vector< message_frame_buffer > | Buffers_ |
char ** | completed_message |
bool | has_ended_ |
bool | is_active_ |
bool | isMulticast_ |
struct sockaddr_in | local_socket_address_ |
long | message_counter |
int | number_of_package_buffers_ |
char * | ServerAddr_ |
int | socket_fd_ |
bool | TCPinsteadOfUDP_ |
UDPDataConsumer * | udc |
class for receiving UDP packages
Definition at line 37 of file UDPClient.hh.
UDPClient::UDPClient | ( | ) |
Definition at line 30 of file UDPClient.cc.
UDPClient::~UDPClient | ( | ) |
Destructor.
Definition at line 460 of file UDPClient.cc.
|
protected |
Definition at line 96 of file UDPClient.cc.
References BIAS::UDP_PACKAGE_SIZE.
|
protected |
Definition at line 65 of file UDPClient.cc.
References BIAS::message_frame_buffer::frame_data, BIAS::message_frame_buffer::frame_number, BIAS::message_frame_buffer::frame_size, BIAS::message_frame_buffer::frames_total, BIAS::message_frame_buffer::is_free, BIAS::message_frame_buffer::number, and BIAS::UDP_PACKAGE_SIZE.
|
protected |
Definition at line 86 of file UDPClient.cc.
|
protected |
Definition at line 183 of file UDPClient.cc.
References BIAS::message_frame_buffer::frame_data, BIAS::message_frame_buffer::frame_number, BIAS::message_frame_buffer::frame_size, BIAS::message_frame_buffer::frames_total, BIAS::message_frame_buffer::is_free, BIAS::message_frame_buffer::number, and BIAS::UDP_PACKAGE_SIZE.
|
inline |
Definition at line 81 of file UDPClient.hh.
void UDPClient::Init | ( | int | port, |
const char * | bind_to_ip = NULL |
||
) |
port | Wait for incoming UDP packages on this port |
bind_to_ip | bin to this IP, of NULL is given use any ip |
Definition at line 46 of file UDPClient.cc.
|
inline |
Definition at line 79 of file UDPClient.hh.
void UDPClient::receive_loop | ( | ) |
Definition at line 229 of file UDPClient.cc.
References BIAS::message_frame_header::message_frame_number, BIAS::message_frame_header::message_frames_total, BIAS::message_frame_header::message_number, and BIAS::UDP_PACKAGE_SIZE.
int UDPClient::start | ( | int | max_message_size, |
int | number_of_message_buffers, | ||
UDPDataConsumer * | uc, | ||
bool | UseTCP = false |
||
) |
Start receiving UDP packages.
The is done in a seperated thread.
number_of_package_buffers | How UDP packages shall be buffered? |
max_message_size | The maximum size of a completed message |
number_of_message_buffers | How many messages can be buffered (at least 1). Therefore the allocated memory size is at least max_message_size * number_of_message_buffers ! |
uc | The UDPDataConsumer whose consume_complete_message()-method is called, when a message has been completed by this client. |
Definition at line 323 of file UDPClient.cc.
References BIAS::UDP_PACKAGE_SIZE.
void UDPClient::stop | ( | ) |
Stop the running client thread.
Definition at line 429 of file UDPClient.cc.
|
protected |
Definition at line 113 of file UDPClient.hh.
|
protected |
Definition at line 91 of file UDPClient.hh.
|
protected |
Definition at line 103 of file UDPClient.hh.
|
protected |
Definition at line 101 of file UDPClient.hh.
|
protected |
Definition at line 98 of file UDPClient.hh.
|
protected |
Definition at line 106 of file UDPClient.hh.
|
protected |
Definition at line 87 of file UDPClient.hh.
|
protected |
Definition at line 122 of file UDPClient.hh.
|
protected |
Definition at line 119 of file UDPClient.hh.
|
protected |
Definition at line 109 of file UDPClient.hh.
|
protected |
Definition at line 123 of file UDPClient.hh.
|
protected |
Definition at line 89 of file UDPClient.hh.