Qpid Proton C++ API  0.17.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
connection_options Class Reference

Options for creating a connection. More...

#include <connection_options.hpp>

Public Member Functions

 connection_options ()
 Create an empty set of options.
 
 connection_options (class messaging_handler &h)
 Shorthand for connection_options().handler(h)
 
 connection_options (const connection_options &)
 Copy options.
 
connection_optionsoperator= (const connection_options &)
 Copy options.
 
connection_optionshandler (class messaging_handler &)
 Set a connection handler. More...
 
connection_optionsmax_frame_size (uint32_t max)
 Set the maximum frame size.
 
connection_optionsmax_sessions (uint16_t max)
 Set the maximum number of open sessions.
 
connection_optionsidle_timeout (duration)
 Set the idle timeout.
 
connection_optionscontainer_id (const std::string &id)
 Set the container ID.
 
connection_optionsvirtual_host (const std::string &name)
 Set the virtual host name for the connection. More...
 
connection_optionsuser (const std::string &user)
 Set the user name used to authenticate the connection. More...
 
connection_optionspassword (const std::string &pass)
 Set the password used to authenticate the connection.
 
connection_optionsssl_client_options (const class ssl_client_options &)
 Set SSL client options.
 
connection_optionsssl_server_options (const class ssl_server_options &)
 Set SSL server options.
 
connection_optionssasl_enabled (bool)
 Enable or disable SASL.
 
connection_optionssasl_allow_insecure_mechs (bool)
 Force the enabling of SASL mechanisms that disclose clear text passwords over the connection. More...
 
connection_optionssasl_allowed_mechs (const std::string &)
 Specify the allowed mechanisms for use on the connection.
 
connection_optionssasl_config_name (const std::string &)
 Experimental - Set the SASL configuration name.
 
connection_optionssasl_config_path (const std::string &)
 Experimental - Set the SASL configuration path.
 
connection_optionsupdate (const connection_options &other)
 Update option values from values set in other.
 

Detailed Description

Options for creating a connection.

Options can be "chained" like this:

c = container.connect(url, connection_options().handler(h).max_frame_size(1234));

You can also create an options object with common settings and use it as a base for different connections that have mostly the same settings:

opts.idle_timeout(1000).max_frame_size(10000);
c1 = container.connect(url1, opts.handler(h1));
c2 = container.connect(url2, opts.handler(h2));

Normal value semantics: copy or assign creates a separate copy of the options.

Examples:
mt/broker.cpp, mt/epoll_container.cpp, service_bus.cpp, simple_recv.cpp, and simple_send.cpp.

Member Function Documentation

connection_options& handler ( class messaging_handler )

Set a connection handler.

The handler must not be deleted until messaging_handler::on_transport_close() is called.

Examples:
mt/broker.cpp.
connection_options& sasl_allow_insecure_mechs ( bool  )

Force the enabling of SASL mechanisms that disclose clear text passwords over the connection.

By default, such mechanisms are disabled.

connection_options& user ( const std::string &  user)

Set the user name used to authenticate the connection.

This will override any user name that is specified in the url used for container::connect. It will be ignored if the connection is created by container::listen as a listening connection has no user name.

Examples:
simple_recv.cpp, and simple_send.cpp.
connection_options& virtual_host ( const std::string &  name)

Set the virtual host name for the connection.

If making a client connection by SSL/TLS, this name is also used for certificate verification and Server Name Indication. For client connections, it defaults to the host name used to set up the connection. It is not set by default for server connections.


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