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:
Inheritance graph
[legend]

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 ( 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:
host The host name or IP address to connect the socket to.
port The port on the remote host to connect to.
ifAddress The address on the local machine to bind the Socket to.
localPort The local port to bind the Socket to.
Returns:
a new Socket object, caller must free this object when done.
Exceptions:
IOException if an I/O error occurs while creating the Socket object.
UnknownHostException if the host name is not known.

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

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:
host The host name or IP address to connect the socket to.
port The port on the remote host to connect to.
Returns:
a new Socket object, caller must free this object when done.
Exceptions:
IOException if an I/O error occurs while creating the Socket object.
UnknownHostException if the host name is not known.

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

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:
host The host to connect the socket to.
port The port on the remote host to connect to.
ifAddress The address on the local machine to bind the Socket to.
localPort The local port to bind the Socket to.
Returns:
a new Socket object, caller must free this object when done.
Exceptions:
IOException if an I/O error occurs while creating the Socket object.
UnknownHostException if the host name is not known.

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

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:
host The host to connect the socket to.
port The port on the remote host to connect to.
Returns:
a new Socket object, caller must free this object when done.
Exceptions:
IOException if an I/O error occurs while creating the Socket object.
UnknownHostException if the host name is not known.

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

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:
IOException if the Socket cannot be created.

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

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:
SocketException if 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:

Generated on 1 Dec 2014 for activemq-cpp-3.8.2 by  doxygen 1.6.1