Package proton :: Class Connection

[frames] | no frames]

# Class Connection

source code

         object --+
                  |
    wrapper.Wrapper --+
                      |
         object --+   |
                  |   |
           Endpoint --+
                      |
                     Connection

A representation of an AMQP connection

Instance Methods

__init__(self, impl=<built-in function pn_connection>) x.__init__(...) initializes x; see help(type(x)) for signature | source code

collect(self, collector) | source code

open(self) Opens the connection. | source code

close(self) Closes the connection. | source code

session(self) Returns a new session on this connection. | source code

session_head(self, mask) | source code

link_head(self, mask) | source code

free(self) | source code

Inherited from `wrapper.Wrapper`: `__del__`, `__delattr__`, `__eq__`, `__getattr__`, `__hash__`, `__ne__`, `__repr__`, `__setattr__` Inherited from `object`: `__format__`, `__getattribute__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods

wrap(impl) | source code

Class Variables
Inherited from `Endpoint`: `LOCAL_ACTIVE`, `LOCAL_CLOSED`, `LOCAL_UNINIT`, `REMOTE_ACTIVE`, `REMOTE_CLOSED`, `REMOTE_UNINIT`

Properties
| connection
| transport
| container
| hostname Set the name of the host (either fully qualified or relative) to which this connection is connecting to.
| user
| password
| remote_container The container identifier specified by the remote peer for this connection.
| remote_hostname The hostname specified by the remote peer for this connection.
| remote_offered_capabilities The capabilities offered by the remote peer for this connection.
| remote_desired_capabilities The capabilities desired by the remote peer for this connection.
| remote_properties The properties specified by the remote peer for this connection.
| state The state of the connection as a bit field.
| work_head
| error
Inherited from `Endpoint`: `handler`, `remote_condition` Inherited from `object`: `__class__`

Method Details

### __init__(self, impl=<built-in function pn_connection>)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)

### open(self)

source code

Opens the connection.

In more detail, this moves the local state of the connection to the ACTIVE state and triggers an open frame to be sent to the peer. A connection is fully active once both peers have opened it.

### close(self)

source code

Closes the connection.

In more detail, this moves the local state of the connection to the CLOSED state and triggers a close frame to be sent to the peer. A connection is fully closed once both peers have closed it.

Property Details

### connection

Get Method:
  unreachable.connection(self)

### transport

Get Method:
  unreachable.transport(self)

### container

Get Method:
  _get_container(self)
Set Method:
  _set_container(self, name)

### hostname

Set the name of the host (either fully qualified or relative) to which this connection is connecting to. This information may be used by the remote peer to determine the correct back-end service to connect the client to. This value will be sent in the Open performative, and will be used by SSL and SASL layers to identify the peer.

Get Method:
  _get_hostname(self)
Set Method:
  _set_hostname(self, name)

### user

Get Method:
  _get_user(self)
Set Method:
  _set_user(self, name)

### password

Get Method:
  _get_password(self)
Set Method:
  _set_password(self, name)

### remote_container

The container identifier specified by the remote peer for this connection.

Get Method:
  unreachable.remote_container(self) - The container identifier specified by the remote peer for this connection.

### remote_hostname

The hostname specified by the remote peer for this connection.

Get Method:
  unreachable.remote_hostname(self) - The hostname specified by the remote peer for this connection.

### remote_offered_capabilities

The capabilities offered by the remote peer for this connection.

Get Method:
  unreachable.remote_offered_capabilities(self) - The capabilities offered by the remote peer for this connection.

### remote_desired_capabilities

The capabilities desired by the remote peer for this connection.

Get Method:
  unreachable.remote_desired_capabilities(self) - The capabilities desired by the remote peer for this connection.

### remote_properties

The properties specified by the remote peer for this connection.

Get Method:
  unreachable.remote_properties(self) - The properties specified by the remote peer for this connection.

### state

The state of the connection as a bit field. The state has a local and a remote component. Each of these can be in one of three states: UNINIT, ACTIVE or CLOSED. These can be tested by masking against LOCAL_UNINIT, LOCAL_ACTIVE, LOCAL_CLOSED, REMOTE_UNINIT, REMOTE_ACTIVE and REMOTE_CLOSED.

Get Method:
  unreachable.state(self) - The state of the connection as a bit field.

### work_head

Get Method:
  unreachable.work_head(self)

### error

Get Method:
  unreachable.error(self)