Scopira
20080306
|
#include <netflow.h>
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_i & | print (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) | |
A UDP socket.
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
bool scopira::tool::udpflow::read_ready | ( | int | msec | ) |
is anything in the input buffer, within the given time? (false==timeout) 1000msec = 1 second
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