activemq::network::SocketInputStream Class Reference

#include <SocketInputStream.h>

Inheritance diagram for activemq::network::SocketInputStream:

activemq::io::InputStream activemq::concurrent::Synchronizable List of all members.

Public Member Functions

 SocketInputStream (Socket::SocketHandle socket)
virtual ~SocketInputStream ()
virtual void setDebug (const bool debug)
virtual void lock () throw ( exceptions::ActiveMQException )
virtual void unlock () throw ( exceptions::ActiveMQException )
virtual void wait () throw ( exceptions::ActiveMQException )
virtual void wait (unsigned long millisecs) throw ( exceptions::ActiveMQException )
virtual void notify () throw ( exceptions::ActiveMQException )
virtual void notifyAll () throw ( exceptions::ActiveMQException )
virtual int available () const
virtual unsigned char read () throw ( io::IOException )
virtual int read (unsigned char *buffer, const int bufferSize) throw (io::IOException)
virtual void close () throw ( cms::CMSException )

Private Attributes

Socket::SocketHandle socket
concurrent::Mutex mutex
bool debug

Detailed Description

Input stream for performing reads on a socket.


Constructor & Destructor Documentation

SocketInputStream::SocketInputStream Socket::SocketHandle  socket  ) 
 

Constructor.

Parameters:
socket the socket handle.

SocketInputStream::~SocketInputStream  )  [virtual]
 

Destructor.


Member Function Documentation

int SocketInputStream::available  )  const [virtual]
 

Polls instantaneously to see if data is available on the socket.

Returns:
1 if data is currently available on the socket, otherwise 0.

Implements activemq::io::InputStream.

virtual void activemq::network::SocketInputStream::close void   )  throw ( cms::CMSException ) [inline, virtual]
 

Close - does nothing. It is the responsibility of the owner of the socket object to close it.

Exceptions:
CMSException 

virtual void activemq::network::SocketInputStream::lock  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Locks the object.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::network::SocketInputStream::notify  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Signals a waiter on this object that it can now wake up and continue. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::network::SocketInputStream::notifyAll  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Signals the waiters on this object that it can now wake up and continue. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

int SocketInputStream::read unsigned char *  buffer,
const int  bufferSize
throw (io::IOException) [virtual]
 

Reads an array of bytes from the buffer.

Parameters:
buffer (out) the target buffer.
bufferSize the size of the output buffer.
Returns:
The number of bytes read.
Exceptions:
IOException thrown if an error occurs.

Implements activemq::io::InputStream.

unsigned char SocketInputStream::read  )  throw ( io::IOException ) [virtual]
 

Reads a single byte from the buffer.

Returns:
The next byte.
Exceptions:
IOException thrown if an error occurs.

Implements activemq::io::InputStream.

virtual void activemq::network::SocketInputStream::setDebug const bool  debug  )  [inline, virtual]
 

Enables socket level output of the recieved data

Parameters:
debug true to turn on debugging

virtual void activemq::network::SocketInputStream::unlock  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Unlocks the object.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::network::SocketInputStream::wait unsigned long  millisecs  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Waits on a signal from this object, which is generated by a call to Notify. Must have this object locked before calling. This wait will timeout after the specified time interval.

Parameters:
millisecs time in millisecsonds to wait, or WAIT_INIFINITE
Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.

virtual void activemq::network::SocketInputStream::wait  )  throw ( exceptions::ActiveMQException ) [inline, virtual]
 

Waits on a signal from this object, which is generated by a call to Notify. Must have this object locked before calling.

Exceptions:
ActiveMQException 

Implements activemq::concurrent::Synchronizable.


Member Data Documentation

bool activemq::network::SocketInputStream::debug [private]
 

concurrent::Mutex activemq::network::SocketInputStream::mutex [private]
 

Socket::SocketHandle activemq::network::SocketInputStream::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