Connection | Connection State
The AMQP 1.0.0 defines the following connection states:
- amqp1csUnknown: initial state.
- amqp1csStart: In this state a connection exists, but nothing has been sent or received. This is the state an
implementation would be in immediately after performing a socket connect or socket accept.
- amqp1csHeaderReceived: In this state the connection header has been received from the peer but a connection header
has not been sent.
- amqp1csHeaderSent: In this state the connection header has been sent to the peer but no connection header has
been received.
- amqp1csHeaderExchanged: In this state the connection header has been sent to the peer and a connection header has
been received from the peer.
- amqp1csOpenPipe: In this state both the connection header and the open frame have been sent but nothing has
been received.
- amqp1csOpenClosePipe: In this state, the connection header, the open frame, any pipelined connection traffic, and
the close frame have been sent but nothing has been received.
- amqp1csOpenReceived: In this state the connection headers have been exchanged. An open frame has been received
from the peer but an open frame has not been sent.
- amqp1csOpenSent: In this state the connection headers have been exchanged. An open frame has been sent
to the peer but no open frame has yet been received.
- amqp1csClosePipe: In this state the connection headers have been exchanged. An open frame, any pipelined
connection traffic, and the close frame have been sent but no open frame has yet been
received from the peer.
- amqp1csOpened: In this state the connection header and the open frame have been both sent and received.
- amqp1csCloseReceived: In this state a close frame has been received indicating that the peer has initiated an AMQP
close. No further frames are expected to arrive on the connection; however, frames can still
be sent. If desired, an implementation MAY do a TCP half-close at this point to shut down
the read side of the connection.
- amqp1csCloseSent: In this state a close frame has been sent to the peer. It is illegal to write anything more
onto the connection, however there could potentially still be incoming frames. If desired,
an implementation MAY do a TCP half-close at this point to shutdown the write side of the
connection.
- amqp1csDiscarding: The DISCARDING state is a variant of the CLOSE SENT state where the close is triggered
by an error. In this case any incoming frames on the connection MUST be silently discarded
until the peer’s close frame is received.
- amqp1csEnd: In this state it is illegal for either endpoint to write anything more onto the connection. The
connection can be safely closed and discarded.
The AMQP Client has the property ConnectionState where you can check in which connection state is the client component.