activemq-cpp-3.6.0
decaf::net::ssl::SSLServerSocket Class Reference

Represents a server socket that is used to accept connections from clients using the Secure Sockets protocol or the Top Level Security protocol. More...

#include <src/main/decaf/net/ssl/SSLServerSocket.h>

Inheritance diagram for decaf::net::ssl::SSLServerSocket:

Public Member Functions

virtual ~SSLServerSocket ()
virtual std::vector< std::string > getSupportedCipherSuites () const =0
 Gets a vector containing the names of all the cipher suites that are supported by this SSLServerSocket.
virtual std::vector< std::string > getSupportedProtocols () const =0
 Gets a vector containing the names of all the protocols that could be enabled for this SSLServerSocket instance.
virtual std::vector< std::string > getEnabledCipherSuites () const =0
 Returns a vector containing the names of all the currently enabled Cipher Suites for this SSLServerSocket.
virtual void setEnabledCipherSuites (const std::vector< std::string > &suites)=0
 Sets the Cipher Suites that are to be enabled on the SSLServerSocket connection.
virtual std::vector< std::string > getEnabledProtocols () const =0
 Returns a vector containing the names of all the currently enabled Protocols for this SSLServerSocket.
virtual void setEnabledProtocols (const std::vector< std::string > &protocols)=0
 Sets the Protocols that are to be enabled on the SSLServerSocket connection.
virtual bool getWantClientAuth () const =0
virtual void setWantClientAuth (bool value)=0
 Sets whether or not this Socket will request Client Authentication.
virtual bool getNeedClientAuth () const =0
virtual void setNeedClientAuth (bool value)=0
 Sets whether or not this Socket will require Client Authentication.
- Public Member Functions inherited from decaf::net::ServerSocket
 ServerSocket ()
 Creates a non-bound server socket.
 ServerSocket (int port)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
 ServerSocket (int port, int backlog)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
 ServerSocket (int port, int backlog, const InetAddress *address)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
virtual ~ServerSocket ()
 Releases socket handle if close() hasn't been called.
virtual void bind (const std::string &host, int port)
 Bind and listen to given local IPAddress and port, if the address is empty than a valid local address will be chosen, and if the port of 0 than an available open port will be chosen.
virtual void bind (const std::string &host, int port, int backlog)
 Bind and listen to given local IPAddress and port, if the address is empty than a valid local address will be chosen, and if the port of 0 than an available open port will be chosen.
virtual Socketaccept ()
 Listens for a connection request on the bound IPAddress and Port for this ServerSocket, the caller blocks until a connection is made.
virtual void close ()
 Closes the server socket, causing any Threads blocked on an accept call to throw an Exception.
virtual bool isClosed () const
virtual bool isBound () const
virtual int getReceiveBufferSize () const
 Gets the receive buffer size for this socket, SO_RCVBUF.
virtual void setReceiveBufferSize (int size)
 Sets the receive buffer size for this socket, SO_RCVBUF.
virtual bool getReuseAddress () const
 Gets the reuse address flag, SO_REUSEADDR.
virtual void setReuseAddress (bool reuse)
 Sets the reuse address flag, SO_REUSEADDR.
virtual int getSoTimeout () const
 Gets the timeout for socket operations, SO_TIMEOUT.
virtual void setSoTimeout (int timeout)
 Sets the timeout for socket operations, SO_TIMEOUT.
virtual int getLocalPort () const
 Gets the port number on the Local machine that this ServerSocket is bound to.
virtual std::string toString () const

Protected Member Functions

 SSLServerSocket ()
 Creates a non-bound server socket.
 SSLServerSocket (int port)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
 SSLServerSocket (int port, int backlog)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
 SSLServerSocket (int port, int backlog, const decaf::net::InetAddress *address)
 Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.
- Protected Member Functions inherited from decaf::net::ServerSocket
 ServerSocket (SocketImpl *impl)
 Creates a ServerSocket wrapping the provided SocketImpl instance, this Socket is considered unconnected.
virtual void implAccept (Socket *socket)
 Virtual method that allows a ServerSocket subclass to override the accept call and provide its own SocketImpl for the socket.
virtual int getDefaultBacklog ()
 Allows a subclass to override what is considered the default backlog.
void checkClosed () const
void ensureCreated () const
void setupSocketImpl (int port, int backlog, const InetAddress *ifAddress)

Additional Inherited Members

- Static Public Member Functions inherited from decaf::net::ServerSocket
static void setSocketImplFactory (SocketImplFactory *factory)
 Sets the instance of a SocketImplFactory that the ServerSocket class should use when new instances of this class are created.

Detailed Description

Represents a server socket that is used to accept connections from clients using the Secure Sockets protocol or the Top Level Security protocol.

The main function of this class is to create SSLSocket objects by accepting connections from client sockets over SSL.

Since
1.0

Constructor & Destructor Documentation

decaf::net::ssl::SSLServerSocket::SSLServerSocket ( )
protected

Creates a non-bound server socket.

decaf::net::ssl::SSLServerSocket::SSLServerSocket ( int  port)
protected

Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.

When this constructor is called the size of the backlog queue is set at 50, connections that arrive after the backlog has been reached are refused.

If a SocketImplFactory is registered then the createSocketImpl method on the factory will be called otherwise a default SocketImpl is created.

Parameters
portThe port to bind the ServerSocket to.
Exceptions
IOExceptionif there is an I/O error while performing this operation.
IllegalArgumentExceptionif the port value is negative or greater than 65535.
decaf::net::ssl::SSLServerSocket::SSLServerSocket ( int  port,
int  backlog 
)
protected

Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.

When this constructor is called the size of the backlog queue is set at backlog, connections that arrive after the backlog has been reached are refused. If backlog is zero or negative then the default backlog value of 50 is used.

If a SocketImplFactory is registered then the createSocketImpl method on the factory will be called otherwise a default SocketImpl is created.

Parameters
portThe port to bind the ServerSocket to.
backlogThe the number of incoming connection attempts to queue before connections are refused.
Exceptions
IOExceptionif there is an I/O error while performing this operation.
IllegalArgumentExceptionif the port value is negative or greater than 65535.
decaf::net::ssl::SSLServerSocket::SSLServerSocket ( int  port,
int  backlog,
const decaf::net::InetAddress address 
)
protected

Creates a new ServerSocket bound to the specified port, if the value of port is 0, then any free port is chosen.

If the value of the ifAddress is empty or NULL then the ANY address is used.

When this constructor is called the size of the backlog queue is set at backlog, connections that arrive after the backlog has been reached are refused. If backlog is zero or negative then the default backlog value of 50 is used.

If a SocketImplFactory is registered then the createSocketImpl method on the factory will be called otherwise a default SocketImpl is created.

Parameters
portThe port to bind the ServerSocket to.
backlogThe the number of incoming connection attempts to queue before connections are refused.
ifAddressThe IP Address to bind to on the local machine.
Exceptions
IOExceptionif there is an I/O error while performing this operation.
IllegalArgumentExceptionif the port value is negative or greater than 65535.
virtual decaf::net::ssl::SSLServerSocket::~SSLServerSocket ( )
virtual

Member Function Documentation

virtual std::vector<std::string> decaf::net::ssl::SSLServerSocket::getEnabledCipherSuites ( ) const
pure virtual

Returns a vector containing the names of all the currently enabled Cipher Suites for this SSLServerSocket.

Returns
vector of the names of all enabled Cipher Suites.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual std::vector<std::string> decaf::net::ssl::SSLServerSocket::getEnabledProtocols ( ) const
pure virtual

Returns a vector containing the names of all the currently enabled Protocols for this SSLServerSocket.

Returns
vector of the names of all enabled Protocols.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual bool decaf::net::ssl::SSLServerSocket::getNeedClientAuth ( ) const
pure virtual
Returns
true if the Socket requires client Authentication.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual std::vector<std::string> decaf::net::ssl::SSLServerSocket::getSupportedCipherSuites ( ) const
pure virtual

Gets a vector containing the names of all the cipher suites that are supported by this SSLServerSocket.

Normally not all of these cipher suites will be enabled on the Socket.

Returns
a vector containing the names of all the supported cipher suites.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual std::vector<std::string> decaf::net::ssl::SSLServerSocket::getSupportedProtocols ( ) const
pure virtual

Gets a vector containing the names of all the protocols that could be enabled for this SSLServerSocket instance.

Returns
a vector containing the names of all the supported protocols.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual bool decaf::net::ssl::SSLServerSocket::getWantClientAuth ( ) const
pure virtual
Returns
true if the Socket request client Authentication.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual void decaf::net::ssl::SSLServerSocket::setEnabledCipherSuites ( const std::vector< std::string > &  suites)
pure virtual

Sets the Cipher Suites that are to be enabled on the SSLServerSocket connection.

Each of the named Cipher Suites must appear in the list of supported cipher suites for this connection or an exception will be thrown.

Parameters
suitesAn Vector of names for all the Cipher Suites that are to be enabled.
Exceptions
IllegalArgumentExceptionif the vector is empty or one of the names is invalid.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual void decaf::net::ssl::SSLServerSocket::setEnabledProtocols ( const std::vector< std::string > &  protocols)
pure virtual

Sets the Protocols that are to be enabled on the SSLServerSocket connection.

Each of the named Protocols must appear in the list of supported protocols suites for this connection or an exception will be thrown.

Parameters
protocolsAn Vector of names for all the Protocols that are to be enabled.
Exceptions
IllegalArgumentExceptionif the vector is empty or one of the names is invalid.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual void decaf::net::ssl::SSLServerSocket::setNeedClientAuth ( bool  value)
pure virtual

Sets whether or not this Socket will require Client Authentication.

If set to true the Socket (when used in server mode) will require that the client authenticate itself, if the client doesn't send authentication the socket will not allow negotiation to continue.

Parameters
valueWhether the server socket should require client authentication.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.

virtual void decaf::net::ssl::SSLServerSocket::setWantClientAuth ( bool  value)
pure virtual

Sets whether or not this Socket will request Client Authentication.

If set to true the Socket (when used in server mode) will request that the client authenticate itself, if the client doesn't send authentication the socket will still allow negotiation to continue.

Parameters
valueWhether the server socket should request client authentication.

Implemented in decaf::internal::net::ssl::openssl::OpenSSLServerSocket.


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