unix_buffer Class Reference

This class provides a streambuffer for handling network connections. More...

#include <unix_buffer.H>

Inheritance diagram for unix_buffer:

Inheritance graph
[legend]
Collaboration diagram for unix_buffer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual int detach ()
 unix_buffer (void)
 create an unix_buffer that is ready to be connected to a socket descriptor
 unix_buffer (const int _fd, const int secs_timeout=75)
 unix_buffer (const connection_waiter &cw)
 unix_buffer (const std::string &host, const int port)
virtual ~unix_buffer ()
 destroy the unix_buffer and close network connection (if any was open)

Protected Member Functions

virtual int _get_descriptor () const
virtual int empty_buffer ()
virtual int underflow ()


Detailed Description

This class provides a streambuffer for handling network connections.

Definition at line 928 of file unix_buffer.H.


Constructor & Destructor Documentation

unix_buffer::unix_buffer ( void   )  [inline]

create an unix_buffer that is ready to be connected to a socket descriptor

Definition at line 1032 of file unix_buffer.H.

unix_buffer::unix_buffer ( const int  _fd,
const int  secs_timeout = 75 
) [inline, explicit]

create an unix_buffer that is connected to the given socket descriptor

Parameters:
_fd descriptor of an already opened connection
secs_timeout (optional) timeout in seconds before read/write operations may fail
Remarks:
- connection will be closed on destruction
  • if you want to reuse the descriptor, you should use the default constructor and attach a descriptor later on with autoclose set to false

Definition at line 1046 of file unix_buffer.H.

unix_buffer::unix_buffer ( const connection_waiter cw  )  [inline, explicit]

create an unix_buffer that is connected to the given socket descriptor

Parameters:
cw a connection_waiter object, that returns a descriptor of the next incoming client connection request
Remarks:
connection will automatically be closed on destruction

Definition at line 1057 of file unix_buffer.H.

unix_buffer::unix_buffer ( const std::string host,
const int  port 
) [inline]

create an unix_buffer that connects to the given socket (and create a socket descriptor by itself)

Parameters:
host string of symbolic/numerical internet address of host to connect
port port number to connect

Definition at line 1069 of file unix_buffer.H.

virtual unix_buffer::~unix_buffer (  )  [inline, virtual]

destroy the unix_buffer and close network connection (if any was open)

Definition at line 1214 of file unix_buffer.H.


Member Function Documentation

virtual int unix_buffer::_get_descriptor (  )  const [inline, protected, virtual]

Reimplemented from unix_fd_buffer.

Definition at line 931 of file unix_buffer.H.

virtual int unix_buffer::empty_buffer (  )  [inline, protected, virtual]

Reimplemented from unix_fd_buffer.

Definition at line 933 of file unix_buffer.H.

References unix_fd_buffer::buffersize, cerr, count(), endl(), errno, my_strerror(), unix_fd_buffer::obuffer, and PTHREAD_TESTCANCEL.

Here is the call graph for this function:

virtual int unix_buffer::underflow (  )  [inline, protected, virtual]

Reimplemented from unix_fd_buffer.

Definition at line 976 of file unix_buffer.H.

References unix_fd_buffer::buffersize, count(), errno, unix_fd_buffer::ibuffer, my_strerror(), PTHREAD_TESTCANCEL, and unix_fd_buffer::pushbacksize.

Here is the call graph for this function:

virtual int unix_buffer::detach (  )  [inline, virtual]

detach the buffer from the socket descriptor

Returns:
an open socket descriptor or -1 if there was no socket descriptor or it has been autoclosed
Remarks:
If returnvalue is not -1, it is most possibly open and should not be thrown away.

Reimplemented from unix_fd_buffer.

Definition at line 1016 of file unix_buffer.H.


The documentation for this class was generated from the following file:
Generated on Wed Nov 7 23:32:23 2007 for Qsieve by  doxygen 1.5.4