activemq::network::Socket Class Reference

#include <Socket.h>

Inheritance diagram for activemq::network::Socket:

activemq::network::BufferedSocket activemq::network::TcpSocket List of all members.

Public Types

typedef SOCKET SocketHandle

Public Member Functions

virtual ~Socket (void)
virtual void connect (const char *host, const int port)=0 throw (SocketException)
virtual bool isConnected () const =0
virtual io::InputStreamgetInputStream ()=0
virtual io::OutputStreamgetOutputStream ()=0
virtual int getSoLinger () const =0 throw ( SocketException )
virtual void setSoLinger (const int linger)=0 throw ( SocketException )
virtual bool getKeepAlive () const =0 throw ( SocketException )
virtual void setKeepAlive (const bool keepAlive)=0 throw ( SocketException )
virtual int getReceiveBufferSize () const =0 throw ( SocketException )
virtual void setReceiveBufferSize (const int size)=0 throw ( SocketException )
virtual bool getReuseAddress () const =0 throw ( SocketException )
virtual void setReuseAddress (const bool reuse)=0 throw ( SocketException )
virtual int getSendBufferSize () const =0 throw ( SocketException )
virtual void setSendBufferSize (const int size)=0 throw ( SocketException )
virtual int getSoTimeout () const =0 throw ( SocketException )
virtual void setSoTimeout (const int timeout)=0 throw ( SocketException )

Static Public Attributes

static const SocketHandle INVALID_SOCKET_HANDLE = (SocketHandle) -1

Member Typedef Documentation

typedef SOCKET activemq::network::Socket::SocketHandle
 


Constructor & Destructor Documentation

virtual activemq::network::Socket::~Socket void   )  [inline, virtual]
 


Member Function Documentation

virtual void activemq::network::Socket::connect const char *  host,
const int  port
throw (SocketException) [pure 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.

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual io::InputStream* activemq::network::Socket::getInputStream  )  [pure virtual]
 

Gets the InputStream for this socket.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual bool activemq::network::Socket::getKeepAlive  )  const throw ( SocketException ) [pure virtual]
 

Gets the keep alive flag.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual io::OutputStream* activemq::network::Socket::getOutputStream  )  [pure virtual]
 

Gets the OutputStream for this socket.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual int activemq::network::Socket::getReceiveBufferSize  )  const throw ( SocketException ) [pure virtual]
 

Gets the receive buffer size.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual bool activemq::network::Socket::getReuseAddress  )  const throw ( SocketException ) [pure virtual]
 

Gets the reuse address flag.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual int activemq::network::Socket::getSendBufferSize  )  const throw ( SocketException ) [pure virtual]
 

Gets the send buffer size.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual int activemq::network::Socket::getSoLinger  )  const throw ( SocketException ) [pure virtual]
 

Gets the linger time.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual int activemq::network::Socket::getSoTimeout  )  const throw ( SocketException ) [pure virtual]
 

Gets the timeout for socket operations.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual bool activemq::network::Socket::isConnected  )  const [pure virtual]
 

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

Returns:
true if connected

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setKeepAlive const bool  keepAlive  )  throw ( SocketException ) [pure virtual]
 

Enables/disables the keep alive flag.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setReceiveBufferSize const int  size  )  throw ( SocketException ) [pure virtual]
 

Sets the recieve buffer size.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setReuseAddress const bool  reuse  )  throw ( SocketException ) [pure virtual]
 

Sets the reuse address flag.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setSendBufferSize const int  size  )  throw ( SocketException ) [pure virtual]
 

Sets the send buffer size.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setSoLinger const int  linger  )  throw ( SocketException ) [pure virtual]
 

Sets the linger time.

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

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.

virtual void activemq::network::Socket::setSoTimeout const int  timeout  )  throw ( SocketException ) [pure 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.

Implemented in activemq::network::BufferedSocket, and activemq::network::TcpSocket.


Member Data Documentation

const SocketHandle activemq::network::Socket::INVALID_SOCKET_HANDLE = (SocketHandle) -1 [static]
 

Defines a constant for an invalid socket handle.


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