connection

A connection to a remote AMQP peer. More...

`#include <connection.hpp>`

Inheritance diagram for connection:
[legend]
Collaboration diagram for connection:
[legend]

## Public Member Functions

| connection ()
| Create an empty connection.
bool | uninitialized () const
| True if the local end is uninitialized.
bool | active () const
| True if the local end is active.
bool | closed () const
| True if the local and remote ends are closed.
class error_condition | error () const
| Get the error condition of the remote endpoint.
class container & | container () const
| Get the container. More...
class transport | transport () const
| Get the transport for the connection.
std::string | virtual_host () const
| Return the AMQP hostname attribute for the connection.
std::string | container_id () const
| Return the container ID for the connection.
std::string | user () const
| Return authenticated user for the connection Note: The value returned is not stable until the on_transport_open event is received.
void | open ()
| Open the connection. More...
void | open (const connection_options &)
| Open the connection. More...
void | close ()
| Close the endpoint. More...
void | close (const error_condition &)
| Close the endpoint with an error condition. More...
session | open_session ()
| Open a new session.
session | open_session (const session_options &)
| Open a new session. More...
session | default_session ()
| Get the default session. More...
sender | open_sender (const std::string &addr)
| Open a sender for `addr` on default_session().
sender | open_sender (const std::string &addr, const sender_options &)
| Open a sender for `addr` on default_session(). More...
receiver | open_receiver (const std::string &addr)
| Open a receiver for `addr` on default_session().
receiver | open_receiver (const std::string &addr, const receiver_options &)
| Open a receiver for `addr` on default_session(). More...
session_range | sessions () const
| Return all sessions on this connection.
receiver_range | receivers () const
| Return all receivers on this connection.
sender_range | senders () const
| Return all senders on this connection.
uint32_t | max_frame_size () const
| Get the maximum frame size. More...
uint16_t | max_sessions () const
| Get the maximum number of open sessions. More...
uint32_t | idle_timeout () const
| Get the idle timeout. More...

## Detailed Description

A connection to a remote AMQP peer.

Examples:
  broker.cpp, broker.hpp, helloworld.cpp, helloworld_direct.cpp, mt/broker.cpp, mt/epoll_container.cpp, server.cpp, and service_bus.cpp.

## Member Function Documentation

## close() [1/2]

void close | ( |  | ) |

virtual

Close the endpoint.

See also
  endpoint_lifecycle

Implements endpoint.

Examples:
  client.cpp, direct_recv.cpp, direct_send.cpp, helloworld.cpp, helloworld_direct.cpp, service_bus.cpp, simple_recv.cpp, and simple_send.cpp.

## close() [2/2]

void close | ( | const error_condition & |  | ) |

virtual

Close the endpoint with an error condition.

See also
  endpoint_lifecycle

Implements endpoint.

## container()

class container& container | ( |  | ) | const

Get the container.

Exceptions

  proton::error | if this connection is not managed by a container

Examples:
  mt/broker.cpp.

## default_session()

session default_session | ( |  | ) |

Get the default session.

A default session is created on the first call and reused for the lifetime of the connection.

## idle_timeout()

uint32_t idle_timeout | ( |  | ) | const

Get the idle timeout.

See also
  connection_options::idle_timeout

## max_frame_size()

uint32_t max_frame_size | ( |  | ) | const

Get the maximum frame size.

See also
  connection_options::max_frame_size

## max_sessions()

uint16_t max_sessions | ( |  | ) | const

Get the maximum number of open sessions.

See also
  connection_options::max_sessions

## open() [1/2]

void open | ( |  | ) |

Open the connection.

See also
  endpoint_lifecycle

Examples:
  mt/broker.cpp.

## open() [2/2]

void open | ( | const connection_options & |  | ) |

Open the connection.

See also
  endpoint_lifecycle

## open_receiver()

receiver open_receiver | ( | const std::string & | addr,
|  | const receiver_options & |
| ) |  |

Open a receiver for `addr` on default_session().

## open_sender()

sender open_sender | ( | const std::string & | addr,
|  | const sender_options & |
| ) |  |

Open a sender for `addr` on default_session().

## open_session()

session open_session | ( | const session_options & |  | ) |

Open a new session.

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

- proton/connection.hpp