activemq-cpp-3.6.0
decaf::net::SocketFactory Class Reference

The SocketFactory is used to create Socket objects and can be sub-classed to provide other types of Sockets or Sockets with varying configurations. More...

#include <src/main/decaf/net/SocketFactory.h>

Inheritance diagram for decaf::net::SocketFactory:

Public Member Functions

virtual ~SocketFactory ()
virtual SocketcreateSocket ()
 Creates an unconnected Socket object.
virtual SocketcreateSocket (const InetAddress *host, int port)=0
 Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
virtual SocketcreateSocket (const InetAddress *host, int port, const InetAddress *ifAddress, int localPort)=0
 Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
virtual SocketcreateSocket (const std::string &name, int port)=0
 Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.
virtual SocketcreateSocket (const std::string &name, int port, const InetAddress *ifAddress, int localPort)=0
 Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.

Static Public Member Functions

static SocketFactorygetDefault ()
 Returns an pointer to the default SocketFactory for this Application, there is only one default SocketFactory per application, the pointer returned by this method is owned by the SocketFactory class and in not to be deleted by the caller.

Protected Member Functions

 SocketFactory ()

Detailed Description

The SocketFactory is used to create Socket objects and can be sub-classed to provide other types of Sockets or Sockets with varying configurations.

See Also
decaf.net.Socket
Since
1.0

Constructor & Destructor Documentation

decaf::net::SocketFactory::SocketFactory ( )
protected
virtual decaf::net::SocketFactory::~SocketFactory ( )
virtual

Member Function Documentation

virtual Socket* decaf::net::SocketFactory::createSocket ( )
virtual

Creates an unconnected Socket object.

Returns
a new Socket object, caller must free this object when done.
Exceptions
IOExceptionif the Socket cannot be created.

Reimplemented in decaf::internal::net::ssl::openssl::OpenSSLSocketFactory, decaf::internal::net::ssl::DefaultSSLSocketFactory, and decaf::internal::net::DefaultSocketFactory.

virtual Socket* decaf::net::SocketFactory::createSocket ( const InetAddress host,
int  port 
)
pure virtual

Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.

Parameters
hostThe host to connect the socket to.
portThe port on the remote host to connect to.
Returns
a new Socket object, caller must free this object when done.
Exceptions
IOExceptionif an I/O error occurs while creating the Socket object.
UnknownHostExceptionif the host name is not known.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLSocketFactory, decaf::internal::net::ssl::DefaultSSLSocketFactory, and decaf::internal::net::DefaultSocketFactory.

virtual Socket* decaf::net::SocketFactory::createSocket ( const InetAddress host,
int  port,
const InetAddress ifAddress,
int  localPort 
)
pure virtual

Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.

The Socket will be bound to the specified local address and port.

Parameters
hostThe host to connect the socket to.
portThe port on the remote host to connect to.
ifAddressThe address on the local machine to bind the Socket to.
localPortThe local port to bind the Socket to.
Returns
a new Socket object, caller must free this object when done.
Exceptions
IOExceptionif an I/O error occurs while creating the Socket object.
UnknownHostExceptionif the host name is not known.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLSocketFactory, decaf::internal::net::ssl::DefaultSSLSocketFactory, and decaf::internal::net::DefaultSocketFactory.

virtual Socket* decaf::net::SocketFactory::createSocket ( const std::string &  name,
int  port 
)
pure virtual

Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.

Parameters
hostThe host name or IP address to connect the socket to.
portThe port on the remote host to connect to.
Returns
a new Socket object, caller must free this object when done.
Exceptions
IOExceptionif an I/O error occurs while creating the Socket object.
UnknownHostExceptionif the host name is not known.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLSocketFactory, decaf::internal::net::ssl::DefaultSSLSocketFactory, and decaf::internal::net::DefaultSocketFactory.

virtual Socket* decaf::net::SocketFactory::createSocket ( const std::string &  name,
int  port,
const InetAddress ifAddress,
int  localPort 
)
pure virtual

Creates a new Socket object and connects it to the specified remote host and port using the configuration of this SocketFactory.

Parameters
hostThe host name or IP address to connect the socket to.
portThe port on the remote host to connect to.
ifAddressThe address on the local machine to bind the Socket to.
localPortThe local port to bind the Socket to.
Returns
a new Socket object, caller must free this object when done.
Exceptions
IOExceptionif an I/O error occurs while creating the Socket object.
UnknownHostExceptionif the host name is not known.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLSocketFactory, decaf::internal::net::ssl::DefaultSSLSocketFactory, and decaf::internal::net::DefaultSocketFactory.

static SocketFactory* decaf::net::SocketFactory::getDefault ( )
static

Returns an pointer to the default SocketFactory for this Application, there is only one default SocketFactory per application, the pointer returned by this method is owned by the SocketFactory class and in not to be deleted by the caller.

Returns
pointer to the applications default SocketFactory.
Exceptions
SocketExceptionif an error occurs while getting the default instance.

Reimplemented in decaf::net::ssl::SSLSocketFactory.


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