Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::UDPServer Class Reference

UDP server class. More...

#include <NetworkComm/UDPServer.hh>

+ Inheritance diagram for BIAS::UDPServer:
+ Collaboration diagram for BIAS::UDPServer:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
int Connect (const char *ipaddress_or_name, int port, bool UseTCP=false)
 open a UDP socket to the given host:port More...
 
int Connect (int port, bool UseTCP=false)
 open a UDP socket to the given port More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
int Disconnect ()
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
unsigned int GetMessageSize ()
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
int Send (const char *message, const size_t message_size)
 Send a message. More...
 
int SendToUDP (const char *message, const size_t message_size, const char *ipAddress, int port)
 Send a message to a given host:port (UDP only) More...
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetThrottle (const unsigned int t)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
 UDPServer ()
 Constructor,. More...
 
 ~UDPServer ()
 Destructor. More...
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
char * ImgBuffer_
 
unsigned int ImgBufferSize_
 
int message_counter_
 
unsigned int MessageSize_
 
char * send_buffer_
 
int socket_descriptor_
 
bool TCPinsteadOfUDP_
 
struct sockaddr TCPSockAddr_
 
unsigned int Throttle_
 
struct sockaddr_in UDPSockAddr_
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

UDP server class.

Author
Ingo Thomsen

Definition at line 27 of file UDPServer.hh.

Constructor & Destructor Documentation

UDPServer::UDPServer ( )

Constructor,.

Author
Ingo Thomsen

Definition at line 29 of file UDPServer.cc.

References BIAS::UDP_PACKAGE_SIZE.

UDPServer::~UDPServer ( )

Destructor.

Author
Ingo Thomsen

Definition at line 41 of file UDPServer.cc.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

int UDPServer::Connect ( const char *  ipaddress_or_name,
int  port,
bool  UseTCP = false 
)

open a UDP socket to the given host:port

Author
evers

Definition at line 249 of file UDPServer.cc.

int UDPServer::Connect ( int  port,
bool  UseTCP = false 
)

open a UDP socket to the given port

Author
Ingo Schiller

Definition at line 324 of file UDPServer.cc.

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

int UDPServer::Disconnect ( )

Definition at line 369 of file UDPServer.cc.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

unsigned int BIAS::UDPServer::GetMessageSize ( )
inline

Definition at line 77 of file UDPServer.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

int UDPServer::Send ( const char *  message,
const size_t  message_size 
)

Send a message.

Author
Ingo Thomsen
Parameters
messageA char pointer to the beginning of the message
message_sizeThe Size of the message
Returns
-1 in any case of failure, otherwise the number of UDP packages successfully sent

Definition at line 47 of file UDPServer.cc.

References BIAS::maxMessageNumber, 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 UDPServer::SendToUDP ( const char *  message,
const size_t  message_size,
const char *  ipAddress,
int  port 
)

Send a message to a given host:port (UDP only)

Author
mfranke
Parameters
messageA char pointer to the beginning of the message
message_sizeThe size of the message
ipAddressThe host ip address
portThe host port
Returns
-1 in any case of failure, otherwise the number of UDP packages successfully sent

Definition at line 143 of file UDPServer.cc.

References BIAS::maxMessageNumber, 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.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::UDPServer::SetThrottle ( const unsigned int  t)
inline

Definition at line 76 of file UDPServer.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

char* BIAS::UDPServer::ImgBuffer_
protected

Definition at line 103 of file UDPServer.hh.

unsigned int BIAS::UDPServer::ImgBufferSize_
protected

Definition at line 105 of file UDPServer.hh.

int BIAS::UDPServer::message_counter_
protected

Definition at line 92 of file UDPServer.hh.

unsigned int BIAS::UDPServer::MessageSize_
protected

Definition at line 98 of file UDPServer.hh.

char* BIAS::UDPServer::send_buffer_
protected

Definition at line 88 of file UDPServer.hh.

int BIAS::UDPServer::socket_descriptor_
protected

Definition at line 85 of file UDPServer.hh.

bool BIAS::UDPServer::TCPinsteadOfUDP_
protected

Definition at line 100 of file UDPServer.hh.

struct sockaddr BIAS::UDPServer::TCPSockAddr_
protected

Definition at line 83 of file UDPServer.hh.

unsigned int BIAS::UDPServer::Throttle_
protected

Definition at line 96 of file UDPServer.hh.

struct sockaddr_in BIAS::UDPServer::UDPSockAddr_
protected

Definition at line 82 of file UDPServer.hh.


The documentation for this class was generated from the following files: