activemq::network::BufferedSocket Class Reference

#include <BufferedSocket.h>

Inheritance diagram for activemq::network::BufferedSocket:

activemq::network::Socket List of all members.

Public Member Functions

 BufferedSocket (Socket *socket, unsigned int inputBufferSize=1000, unsigned int outputBufferSize=1000, bool own=true)
virtual ~BufferedSocket (void)
virtual void connect (const char *host, const int port) throw ( SocketException )
virtual void close () throw ( cms::CMSException )
virtual bool isConnected () const
virtual io::InputStreamgetInputStream ()
virtual io::OutputStreamgetOutputStream ()
virtual int getSoLinger () const throw ( SocketException )
virtual void setSoLinger (const int linger) throw ( SocketException )
virtual bool getKeepAlive () const throw ( SocketException )
virtual void setKeepAlive (const bool keepAlive) throw ( SocketException )
virtual int getReceiveBufferSize () const throw ( SocketException )
virtual void setReceiveBufferSize (const int size) throw ( SocketException )
virtual bool getReuseAddress () const throw ( SocketException )
virtual void setReuseAddress (const bool reuse) throw ( SocketException )
virtual int getSendBufferSize () const throw ( SocketException )
virtual void setSendBufferSize (const int size) throw ( SocketException )
virtual int getSoTimeout () const throw ( SocketException )
virtual void setSoTimeout (const int timeout) throw ( SocketException )

Private Attributes

Socketsocket
bool own
io::BufferedInputStreaminputStream
io::BufferedOutputStreamoutputStream
unsigned int inputBufferSize
unsigned int outputBufferSize

Detailed Description

Buffered Socket class that wraps a Socket derived object and provides Buffered input and Output Streams to improce the efficiency of the reads and writes.


Constructor & Destructor Documentation

BufferedSocket::BufferedSocket Socket socket,
unsigned int  inputBufferSize = 1000,
unsigned int  outputBufferSize = 1000,
bool  own = true
 

Constructs a new Buffered socket object

Parameters:
socket the socket to buffer
inputBufferSize size of the input buffer
outputBufferSize size of the output buffer
own does this object own the passed socket

BufferedSocket::~BufferedSocket void   )  [virtual]
 


Member Function Documentation

void BufferedSocket::close  )  throw ( cms::CMSException ) [virtual]
 

Closes this object and deallocates the appropriate resources.

Exceptions:
CMSException 

void BufferedSocket::connect const char *  host,
const int  port
throw ( SocketException ) [virtual]
 

Connects to the specified destination. Closes this socket if connected to another destination.

Parameters:
host The host of the server to connect to.
port The port of the server to connect to.
Exceptions:
IOException Thrown if a failure occurred in the connect.

Implements activemq::network::Socket.

virtual io::InputStream* activemq::network::BufferedSocket::getInputStream  )  [inline, virtual]
 

Gets the InputStream for this socket.

Returns:
The InputStream for this socket. NULL if not connected.

Implements activemq::network::Socket.

virtual bool activemq::network::BufferedSocket::getKeepAlive  )  const throw ( SocketException ) [inline, virtual]
 

Gets the keep alive flag.

Returns:
True if keep alive is enabled.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual io::OutputStream* activemq::network::BufferedSocket::getOutputStream  )  [inline, virtual]
 

Gets the OutputStream for this socket.

Returns:
the OutputStream for this socket. NULL if not connected.

Implements activemq::network::Socket.

virtual int activemq::network::BufferedSocket::getReceiveBufferSize  )  const throw ( SocketException ) [inline, virtual]
 

Gets the receive buffer size.

Returns:
the receive buffer size in bytes.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual bool activemq::network::BufferedSocket::getReuseAddress  )  const throw ( SocketException ) [inline, virtual]
 

Gets the reuse address flag.

Returns:
True if the address can be reused.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual int activemq::network::BufferedSocket::getSendBufferSize  )  const throw ( SocketException ) [inline, virtual]
 

Gets the send buffer size.

Returns:
the size in bytes of the send buffer.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual int activemq::network::BufferedSocket::getSoLinger  )  const throw ( SocketException ) [inline, virtual]
 

Gets the linger time.

Returns:
The linger time in seconds.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual int activemq::network::BufferedSocket::getSoTimeout  )  const throw ( SocketException ) [inline, virtual]
 

Gets the timeout for socket operations.

Returns:
The timeout in milliseconds for socket operations.
Exceptions:
SocketException Thrown if unable to retrieve the information.

Implements activemq::network::Socket.

virtual bool activemq::network::BufferedSocket::isConnected  )  const [inline, virtual]
 

Indicates whether or not this socket is connected to a destination.

Returns:
true if connected

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setKeepAlive const bool  keepAlive  )  throw ( SocketException ) [inline, virtual]
 

Enables/disables the keep alive flag.

Parameters:
keepAlive If true, enables the flag.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setReceiveBufferSize const int  size  )  throw ( SocketException ) [inline, virtual]
 

Sets the recieve buffer size.

Parameters:
size Number of bytes to set the receive buffer to.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setReuseAddress const bool  reuse  )  throw ( SocketException ) [inline, virtual]
 

Sets the reuse address flag.

Parameters:
reuse If true, sets the flag.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setSendBufferSize const int  size  )  throw ( SocketException ) [inline, virtual]
 

Sets the send buffer size.

Parameters:
size The number of bytes to set the send buffer to.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setSoLinger const int  linger  )  throw ( SocketException ) [inline, virtual]
 

Sets the linger time.

Parameters:
linger The linger time in seconds. If 0, linger is off.
Exceptions:
SocketException if the operation fails.

Implements activemq::network::Socket.

virtual void activemq::network::BufferedSocket::setSoTimeout const int  timeout  )  throw ( SocketException ) [inline, virtual]
 

Sets the timeout for socket operations.

Parameters:
timeout The timeout in milliseconds for socket operations.
Exceptions:
SocketException Thrown if unable to set the information.

Implements activemq::network::Socket.


Member Data Documentation

unsigned int activemq::network::BufferedSocket::inputBufferSize [private]
 

io::BufferedInputStream* activemq::network::BufferedSocket::inputStream [private]
 

unsigned int activemq::network::BufferedSocket::outputBufferSize [private]
 

io::BufferedOutputStream* activemq::network::BufferedSocket::outputStream [private]
 

bool activemq::network::BufferedSocket::own [private]
 

Socket* activemq::network::BufferedSocket::socket [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Aug 3 18:03:33 2006 for activemq-cpp by  doxygen 1.4.5