Scopira  20080306
scopira::tool::unixflow Class Reference

#include <netflow.h>

Inheritance diagram for scopira::tool::unixflow:
scopira::tool::iflow_i scopira::tool::oflow_i scopira::tool::flow_i scopira::tool::flow_i scopira::tool::object scopira::tool::object

Public Member Functions

 unixflow (void)
 default ctor
 
 unixflow (const std::string &filename, bool server_mode)
 opening ctor
 
virtual ~unixflow ()
 dtor
 
virtual bool failed (void) const
 are we in a failed state?
 
virtual size_t read (byte_t *_buf, size_t _maxsize)
 read raw block data, returns num read in
 
virtual size_t write (const byte_t *_buf, size_t _size)
 write a raw block of data
 
void open (const std::string &filename, bool server_mode)
 opens a client socket, null _addr for server socket
 
void close (void)
 close the file
 
bool accept (unixflow &nconn)
 
bool read_ready (int msec)
 
const std::string & get_filename (void) const
 gets the address
 
bool is_server (void) const
 is this a server socket?
 
- Public Member Functions inherited from scopira::tool::iflow_i
virtual size_t read_byte (byte_t &out)
 
template<class TT >
size_t read_array (TT *_buf, size_t _numelem)
 
size_t read_void (void *_buf, size_t _maxsize)
 
- 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
 
- Public Member Functions inherited from scopira::tool::oflow_i
virtual size_t write_byte (byte_t b)
 
template<class TT >
size_t write_array (const TT *_buf, size_t _numelem)
 
size_t write_void (const void *_buf, size_t _size)
 

Protected Member Functions

void open_relay (int _fd, const std::string &filename)
 internal, used by server ::accept
 
- Protected Member Functions inherited from scopira::tool::object
 object (void)
 
 object (bool neverusecounter)
 

Protected Attributes

std::string dm_filename
 
bool dm_server
 
bool dm_open
 
bool dm_fail
 
bool dm_sfail
 
int dm_sock
 

Additional Inherited Members

- Public Types inherited from scopira::tool::flow_i
enum  { input_c = 1, output_c = 2 }
 
typedef scopira::tool::byte_t byte_t
 
typedef int mode_t
 

Detailed Description

A "UNIX domain" socket.

TODO This class has not been tested at all. It's implementation is based on netflow and p372 of UNIX Systems Programming for SVR4

Author
Aleksander Demko

Member Function Documentation

◆ accept()

bool scopira::tool::unixflow::accept ( unixflow nconn)

(for server), opens the given connection to the new link returns true if a new linke came in, false on error

◆ read_ready()

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

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


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