Cross-Platform C++

ot::ssl
class SSLSocketFactory  (abstract)

#include "ot/ssl/SSLSocketFactory.h"

ot::net::SocketFactory ot::ManagedObject




Method Summary
 virtual RefPtr< Socket > createSocket()=0
         Creates an unconnected SSLSocket.
 virtual RefPtr< Socket > createSocket(InetAddress* pAddress, int port)=0
         Creates a Socket and connects it to the specified port on the network host designated by the provided InetAddress.
 virtual RefPtr< Socket > createSocket(const String& host, int port)=0
         Creates a Socket that is connected to a specified host name and port.
 virtual RefPtr< Socket > createSocket(Socket* pSocket, const String& host, int port)=0
         Creates a SSLSocket that wraps an already connected Socket.
 virtual RefPtr< Socket > createSocket(InetAddress* pAddress, int port, InetAddress* pLocalAddr, int localPort)=0
         Creates a Socket and connects it to the specified remote port on the network host designated by the provided InetAddress.
 virtual RefPtr< Socket > createSocket(const String& host, int port, InetAddress* pLocalAddr, int localPort)=0
         Creates a Socket that is connected to a specified host name and port.
static RefPtr< SSLSocketFactory > GetDefault()
         Returns the default implementation of the SSLSocketFactory class.

Methods inherited from class ot::ManagedObject
addRef(), getRefCount(), onFinalRelease(), operator=(const ManagedObject&), release()

Method Detail

createSocket

virtual RefPtr< SocketcreateSocket()=0
Creates an unconnected SSLSocket. Before the socket can be used to communicate with an end-point, it must first be connected using Socket::connect().

Exceptions:
SocketException - if an error occurs creating the SSLSocket.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

createSocket

virtual RefPtr< SocketcreateSocket(InetAddress* pAddress,
                                      int port)=0
Creates a Socket and connects it to the specified port on the network host designated by the provided InetAddress.

Parameters:
pAddress - the IP Address of the remote host.
port - the port on the remote host.
Exceptions:
SocketException - if an error occurs creating or connecting the socket.
NullPointerException - if pAddress is null.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

createSocket

virtual RefPtr< SocketcreateSocket(const String& host,
                                      int port)=0
Creates a Socket that is connected to a specified host name and port. The host name is first resolved into an InetAddress before connecting to it.

Parameters:
host - the name of the remote host or a string representation of its IP-address in the form "xxx.xxx.xxx.xxx".
Exceptions:
UnknownHostException - if host cannot be resolved into an Internet address.
SocketException - if an error occurs creating or connecting the socket.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

createSocket

virtual RefPtr< SocketcreateSocket(Socket* pSocket,
                                      const String& host,
                                      int port)=0
Creates a SSLSocket that wraps an already connected Socket. This is useful when creating a tunnelled SSL connection via a proxy or when establishing a SSL Session over an existing Socket connection.

The host and port parameters are used to specify the logical SSL peer (for authentication) and may not be the same as the host/port to which the underlying socket is connected.

Parameters:
pSocket - a pointer to the connected Socket.
host - the host name of the remote peer to which a SSL session will be established.
port - the designated port number on the remote peer.
Exceptions:
NullPointerException - if pSocket is null.
IllegalArgumentException - if pSocket is not connected.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

createSocket

virtual RefPtr< SocketcreateSocket(InetAddress* pAddress,
                                      int port,
                                      InetAddress* pLocalAddr,
                                      int localPort)=0
Creates a Socket and connects it to the specified remote port on the network host designated by the provided InetAddress. The created Socket is bound to the specified local port and InetAddress.

If pLocalAddr is null, the socket is bound to any interface on the local host. If localPort is 0, the operating system chooses an unused local port number.

Parameters:
pAddress - the InetAddress of the remote host.
port - the port number on the remote host.
pLocalAddr - the local network interface to connect from.
localPort - the local port number to use, or zero for a system-assigned port. On UNIX systems, a port number below 1025 requires special system privileges.
Exceptions:
NullPointerException - if pAddress is null.
SocketException - if an error occurs creating, binding or connecting the socket.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

createSocket

virtual RefPtr< SocketcreateSocket(const String& host,
                                      int port,
                                      InetAddress* pLocalAddr,
                                      int localPort)=0
Creates a Socket that is connected to a specified host name and port. The created Socket is bound to the specified local port and network interface.

The host name is first resolved into an InetAddress before connecting to it.

Parameters:
host - the name of the remote host or a string representation of its IP-address in the form "xxx.xxx.xxx.xxx".
port - the port number on the remote host.
pLocalAddr - the local network interface to connect from.
localPort - the local port number to use, or zero for a system-assigned port. On UNIX systems, a port number below 1025 requires special system privileges.
Exceptions:
UnknownHostException - if host cannot be resolved into an Internet address.
SocketException - if an error occurs creating, binding or connecting the socket.
UnsupportedOperationException - if the implementation of OpenTop does not contain an implementation of SSL.

GetDefault

static RefPtr< SSLSocketFactory > GetDefault()
Returns the default implementation of the SSLSocketFactory class. The default implementation is retrieved from the default SSLContext, so this method is a shorthand for: SSLContext::GetDefault()->getSocketFactory();

Exceptions:
UnsupportedOperationException - if OpenTop has been built without support for a built-in security provider such as OpenSSL, and the application has not provided a custom default.


Cross-Platform C++

Found a bug or missing feature? Please email us at support@elcel.com

Copyright © 2000-2005 ElCel Technology   Trademark Acknowledgements