Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes

ibrcommon::tcpstream Class Reference

#include <tcpstream.h>

Inherited by ibrcommon::tcpclient.

List of all members.

Public Types

enum  stream_error {
  ERROR_NONE = 0, ERROR_EPIPE = 1, ERROR_CLOSED = 2, ERROR_WRITE = 3,
  ERROR_READ = 4, ERROR_RESET = 5
}

Public Member Functions

 tcpstream (int socket=-1)
virtual ~tcpstream ()
string getAddress () const
int getPort () const
void close (bool errorcheck=false)
void enableKeepalive ()
void enableLinger (int linger)
void enableNoDelay ()

Public Attributes

stream_error errmsg

Static Public Attributes

static const size_t BUFF_SIZE = 5120

Protected Member Functions

virtual int sync ()
virtual int overflow (int=std::char_traits< char >::eof())
virtual int underflow ()

Protected Attributes

int _socket

Detailed Description

Definition at line 28 of file tcpstream.h.


Member Enumeration Documentation

Enumerator:
ERROR_NONE 
ERROR_EPIPE 
ERROR_CLOSED 
ERROR_WRITE 
ERROR_READ 
ERROR_RESET 

Definition at line 31 of file tcpstream.h.


Constructor & Destructor Documentation

ibrcommon::tcpstream::tcpstream ( int  socket = -1  ) 

Definition at line 21 of file tcpstream.cpp.

References BUFF_SIZE.

ibrcommon::tcpstream::~tcpstream (  )  [virtual]

Definition at line 29 of file tcpstream.cpp.

References close().

Here is the call graph for this function:


Member Function Documentation

void ibrcommon::tcpstream::close ( bool  errorcheck = false  ) 

Definition at line 56 of file tcpstream.cpp.

References _socket.

Referenced by main(), overflow(), term(), underflow(), and ~tcpstream().

void ibrcommon::tcpstream::enableKeepalive (  ) 

Definition at line 169 of file tcpstream.cpp.

References _socket.

Referenced by dtn::net::TCPConnection::TCPConnection().

void ibrcommon::tcpstream::enableLinger ( int  linger  ) 

Definition at line 178 of file tcpstream.cpp.

References _socket.

Referenced by dtn::net::TCPConnection::TCPConnection().

void ibrcommon::tcpstream::enableNoDelay (  ) 
string ibrcommon::tcpstream::getAddress (  )  const

Definition at line 38 of file tcpstream.cpp.

References _socket.

int ibrcommon::tcpstream::getPort (  )  const

Definition at line 47 of file tcpstream.cpp.

References _socket.

int ibrcommon::tcpstream::overflow ( int  c = std::char_traits<char>::eof()  )  [protected, virtual]

Definition at line 82 of file tcpstream.cpp.

References _socket, BUFF_SIZE, close(), errmsg, and IBRCOMMON_LOGGER_DEBUG.

Referenced by sync().

Here is the call graph for this function:

int ibrcommon::tcpstream::sync (  )  [protected, virtual]

Definition at line 73 of file tcpstream.cpp.

References overflow().

Here is the call graph for this function:

int ibrcommon::tcpstream::underflow (  )  [protected, virtual]

Definition at line 130 of file tcpstream.cpp.

References _socket, BUFF_SIZE, close(), and errmsg.

Here is the call graph for this function:


Member Data Documentation

const size_t ibrcommon::tcpstream::BUFF_SIZE = 5120 [static]

Definition at line 42 of file tcpstream.h.

Referenced by overflow(), tcpstream(), and underflow().

Definition at line 52 of file tcpstream.h.

Referenced by overflow(), and underflow().


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