Scopira  20080306
scopira::tool::udpflow Class Reference

#include <netflow.h>

Inheritance diagram for scopira::tool::udpflow:
scopira::tool::object

Public Member Functions

 udpflow (void)
 ctor
 
 udpflow (int _port)
 ctor, on the given port, 0 for any
 
virtual ~udpflow ()
 dtor
 
bool failed (void) const
 in a failed state?
 
size_t read (netaddr &actualsrc, int &actualport, byte_t *_buf, size_t _maxsize)
 
size_t write (netaddr dest, int destport, const byte_t *_buf, size_t _size)
 
void open (int _port)
 opens a udp socket, with the given port, 0 for any
 
void close (void)
 close the file
 
bool read_ready (int msec)
 
int get_port (void) const
 gets the port
 
- Public Member Functions inherited from scopira::tool::object
virtual ~object ()
 
int add_ref (void) const
 
bool sub_ref (void) const
 
void auto_ref (void) const
 
int current_ref (void) const
 
virtual scopira::tool::oflow_iprint (scopira::tool::oflow_i &o) const
 
virtual bool load (scopira::tool::iobjflow_i &in)
 
virtual void save (scopira::tool::oobjflow_i &out) const
 
bool is_alive_object (void) const
 
bool is_dead_object (void) const
 

Additional Inherited Members

- Protected Member Functions inherited from scopira::tool::object
 object (void)
 
 object (bool neverusecounter)
 

Detailed Description

A UDP socket.

Author
Aleksander Demko

Member Function Documentation

◆ read()

size_t scopira::tool::udpflow::read ( netaddr actualsrc,
int &  actualport,
byte_t *  _buf,
size_t  _maxsize 
)

read raw block data, returns num read in src may be netaddr::any(). actualsrc may be null, but if it isnt, it will be the actual src if the packet is bigger than the _maxsize, it will be trunced. if the packet is smaller than the _maxsize, the actual size is returned

◆ read_ready()

bool scopira::tool::udpflow::read_ready ( int  msec)

is anything in the input buffer, within the given time? (false==timeout) 1000msec = 1 second

◆ write()

size_t scopira::tool::udpflow::write ( netaddr  dest,
int  destport,
const byte_t *  _buf,
size_t  _size 
)

write a raw block of data if return 0 and not failed, then your _size > MTU remember that OS's fragmentation system pushes the perceived MTU much higher


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