C# Class RabbitMQ.Client.Impl.ConnectionBase

Inheritance: IConnection
Afficher le fichier Open project: CSGOpenSource/rabbitmq-dotnet-client Class Usage Examples

Méthodes publiques

Свойство Type Description
HandshakeTimeout int
m_appContinuation System.Threading.ManualResetEvent
m_callbackException CallbackExceptionEventHandler
m_clientProperties object>.IDictionary
m_closeReason RabbitMQ.Client.ShutdownEventArgs
m_closed bool
m_connectionBlocked ConnectionBlockedEventHandler
m_connectionShutdown ConnectionShutdownEventHandler
m_connectionUnblocked ConnectionUnblockedEventHandler
m_eventLock object
m_factory RabbitMQ.Client.ConnectionFactory
m_frameHandler IFrameHandler
m_frameMax uint
m_heartbeat ushort
m_heartbeatFrame Frame
m_heartbeatRead System.Threading.AutoResetEvent
m_heartbeatWrite System.Threading.AutoResetEvent
m_id System.Guid
m_knownHosts RabbitMQ.Client.AmqpTcpEndpoint[]
m_missedHeartbeats int
m_model0 ModelBase
m_running bool
m_serverProperties object>.IDictionary
m_session0 RabbitMQ.Client.Impl.MainSession
m_sessionManager RabbitMQ.Client.Impl.SessionManager
m_shutdownReport IList

Private Properties

Свойство Type Description
IDisposable void
NegotiatedMaxValue uint

Méthodes publiques

Méthode Description
Abort ( ) : void

API-side invocation of connection abort.

Abort ( int timeout ) : void

API-side invocation of connection abort with timeout.

Abort ( ushort reasonCode, string reasonText ) : void

API-side invocation of connection abort.

Abort ( ushort reasonCode, string reasonText, ShutdownInitiator initiator, int timeout ) : void
Abort ( ushort reasonCode, string reasonText, int timeout ) : void

API-side invocation of connection abort with timeout.

Close ( ) : void

API-side invocation of connection.close.

Close ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
Close ( RabbitMQ.Client.ShutdownEventArgs reason, bool abort, int timeout ) : void

Try to close connection in a graceful way

Shutdown reason contains code and text assigned when closing the connection, as well as the information about what initiated the close

Abort flag, if true, signals to close the ongoing connection immediately and do not report any errors if it was already closed.

Timeout determines how much time internal close operations should be given to complete. Negative or Timeout.Infinite value mean infinity.

Close ( int timeout ) : void

API-side invocation of connection.close with timeout.

Close ( ushort reasonCode, string reasonText ) : void

API-side invocation of connection.close.

Close ( ushort reasonCode, string reasonText, int timeout ) : void

API-side invocation of connection.close with timeout.

ClosingLoop ( ) : void Loop only used while quiescing. Use only to cleanly close connection
ConnectionBase ( ConnectionFactory factory, bool insist, IFrameHandler frameHandler ) : System
ConnectionCloseWrapper ( ushort reasonCode, string reasonText ) : Command
CreateModel ( ) : IModel
CreateSession ( ) : ISession
CreateSession ( int channelNumber ) : ISession
DefaultClientProperties ( ) : object>.IDictionary
FinishClose ( ) : void
HandleConnectionBlocked ( string reason ) : void
HandleConnectionUnblocked ( ) : void
HandleDomainUnload ( object sender, EventArgs ea ) : void We need to close the socket, otherwise attempting to unload the domain could cause a CannotUnloadAppDomainException
HandleMainLoopException ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
HardProtocolExceptionHandler ( RabbitMQ.Client.Impl.HardProtocolException hpe ) : bool
HeartbeatReadLoop ( ) : void
HeartbeatWriteLoop ( ) : void
InternalClose ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
LogCloseError ( String error, Exception ex ) : void
MainLoop ( ) : void
MainLoopIteration ( ) : void
NotifyHeartbeatThread ( ) : void
NotifyReceivedCloseOk ( ) : void
OnCallbackException ( RabbitMQ.Client.Events.CallbackExceptionEventArgs args ) : void
OnConnectionBlocked ( RabbitMQ.Client.Events.ConnectionBlockedEventArgs args ) : void
OnConnectionUnblocked ( ) : void
OnShutdown ( ) : void

Broadcasts notification of the final shutdown of the connection.

Open ( bool insist ) : void
PrettyPrintShutdownReport ( ) : void
QuiesceChannel ( RabbitMQ.Client.Impl.SoftProtocolException pe ) : void

Sets the channel named in the SoftProtocolException into "quiescing mode", where we issue a channel.close and ignore everything except for subsequent channel.close messages and the channel.close-ok reply that should eventually arrive.

Since a well-behaved peer will not wait indefinitely before issuing the close-ok, we don't bother with a timeout here; compare this to the case of a connection.close-ok, where a timeout is necessary.

We need to send the close method and politely wait for a reply before marking the channel as available for reuse.

As soon as SoftProtocolException is detected, we should stop servicing ordinary application work, and should concentrate on bringing down the channel as quickly and gracefully as possible. The way this is done, as per the close-protocol, is to signal closure up the stack *before* sending the channel.close, by invoking ISession.Close. Once the upper layers have been signalled, we are free to do what we need to do to clean up and shut down the channel.

SetCloseReason ( RabbitMQ.Client.ShutdownEventArgs reason ) : bool
StartHeartbeatLoop ( ThreadStart loop, string name, bool useBackgroundThread ) : void
StartHeartbeatLoops ( bool useBackgroundThread ) : void
StartMainLoop ( bool useBackgroundThread ) : void
TerminateMainloop ( ) : void May be called more than once. Should therefore be idempotent.
ToString ( ) : string
WriteFrame ( Frame f ) : void

Méthodes protégées

Méthode Description
ChannelCloseWrapper ( ushort reasonCode, string reasonText ) : Command
StartAndTune ( ) : void

Private Methods

Méthode Description
IDisposable ( ) : void
NegotiatedMaxValue ( uint clientValue, uint serverValue ) : uint

Method Details

Abort() public méthode

API-side invocation of connection abort.
public Abort ( ) : void
Résultat void

Abort() public méthode

API-side invocation of connection abort with timeout.
public Abort ( int timeout ) : void
timeout int
Résultat void

Abort() public méthode

API-side invocation of connection abort.
public Abort ( ushort reasonCode, string reasonText ) : void
reasonCode ushort
reasonText string
Résultat void

Abort() public méthode

public Abort ( ushort reasonCode, string reasonText, ShutdownInitiator initiator, int timeout ) : void
reasonCode ushort
reasonText string
initiator ShutdownInitiator
timeout int
Résultat void

Abort() public méthode

API-side invocation of connection abort with timeout.
public Abort ( ushort reasonCode, string reasonText, int timeout ) : void
reasonCode ushort
reasonText string
timeout int
Résultat void

ChannelCloseWrapper() protected méthode

protected ChannelCloseWrapper ( ushort reasonCode, string reasonText ) : Command
reasonCode ushort
reasonText string
Résultat Command

Close() public méthode

API-side invocation of connection.close.
public Close ( ) : void
Résultat void

Close() public méthode

public Close ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
reason RabbitMQ.Client.ShutdownEventArgs
Résultat void

Close() public méthode

Try to close connection in a graceful way

Shutdown reason contains code and text assigned when closing the connection, as well as the information about what initiated the close

Abort flag, if true, signals to close the ongoing connection immediately and do not report any errors if it was already closed.

Timeout determines how much time internal close operations should be given to complete. Negative or Timeout.Infinite value mean infinity.

public Close ( RabbitMQ.Client.ShutdownEventArgs reason, bool abort, int timeout ) : void
reason RabbitMQ.Client.ShutdownEventArgs
abort bool
timeout int
Résultat void

Close() public méthode

API-side invocation of connection.close with timeout.
public Close ( int timeout ) : void
timeout int
Résultat void

Close() public méthode

API-side invocation of connection.close.
public Close ( ushort reasonCode, string reasonText ) : void
reasonCode ushort
reasonText string
Résultat void

Close() public méthode

API-side invocation of connection.close with timeout.
public Close ( ushort reasonCode, string reasonText, int timeout ) : void
reasonCode ushort
reasonText string
timeout int
Résultat void

ClosingLoop() public méthode

Loop only used while quiescing. Use only to cleanly close connection
public ClosingLoop ( ) : void
Résultat void

ConnectionBase() public méthode

public ConnectionBase ( ConnectionFactory factory, bool insist, IFrameHandler frameHandler ) : System
factory RabbitMQ.Client.ConnectionFactory
insist bool
frameHandler IFrameHandler
Résultat System

ConnectionCloseWrapper() public méthode

public ConnectionCloseWrapper ( ushort reasonCode, string reasonText ) : Command
reasonCode ushort
reasonText string
Résultat Command

CreateModel() public méthode

public CreateModel ( ) : IModel
Résultat IModel

CreateSession() public méthode

public CreateSession ( ) : ISession
Résultat ISession

CreateSession() public méthode

public CreateSession ( int channelNumber ) : ISession
channelNumber int
Résultat ISession

DefaultClientProperties() public static méthode

public static DefaultClientProperties ( ) : object>.IDictionary
Résultat object>.IDictionary

FinishClose() public méthode

public FinishClose ( ) : void
Résultat void

HandleConnectionBlocked() public méthode

public HandleConnectionBlocked ( string reason ) : void
reason string
Résultat void

HandleConnectionUnblocked() public méthode

public HandleConnectionUnblocked ( ) : void
Résultat void

HandleDomainUnload() public méthode

We need to close the socket, otherwise attempting to unload the domain could cause a CannotUnloadAppDomainException
public HandleDomainUnload ( object sender, EventArgs ea ) : void
sender object
ea System.EventArgs
Résultat void

HandleMainLoopException() public méthode

public HandleMainLoopException ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
reason RabbitMQ.Client.ShutdownEventArgs
Résultat void

HardProtocolExceptionHandler() public méthode

public HardProtocolExceptionHandler ( RabbitMQ.Client.Impl.HardProtocolException hpe ) : bool
hpe RabbitMQ.Client.Impl.HardProtocolException
Résultat bool

HeartbeatReadLoop() public méthode

public HeartbeatReadLoop ( ) : void
Résultat void

HeartbeatWriteLoop() public méthode

public HeartbeatWriteLoop ( ) : void
Résultat void

InternalClose() public méthode

public InternalClose ( RabbitMQ.Client.ShutdownEventArgs reason ) : void
reason RabbitMQ.Client.ShutdownEventArgs
Résultat void

LogCloseError() public méthode

public LogCloseError ( String error, Exception ex ) : void
error String
ex System.Exception
Résultat void

MainLoop() public méthode

public MainLoop ( ) : void
Résultat void

MainLoopIteration() public méthode

public MainLoopIteration ( ) : void
Résultat void

NotifyHeartbeatThread() public méthode

public NotifyHeartbeatThread ( ) : void
Résultat void

NotifyReceivedCloseOk() public méthode

public NotifyReceivedCloseOk ( ) : void
Résultat void

OnCallbackException() public méthode

public OnCallbackException ( RabbitMQ.Client.Events.CallbackExceptionEventArgs args ) : void
args RabbitMQ.Client.Events.CallbackExceptionEventArgs
Résultat void

OnConnectionBlocked() public méthode

public OnConnectionBlocked ( RabbitMQ.Client.Events.ConnectionBlockedEventArgs args ) : void
args RabbitMQ.Client.Events.ConnectionBlockedEventArgs
Résultat void

OnConnectionUnblocked() public méthode

public OnConnectionUnblocked ( ) : void
Résultat void

OnShutdown() public méthode

Broadcasts notification of the final shutdown of the connection.
public OnShutdown ( ) : void
Résultat void

Open() public méthode

public Open ( bool insist ) : void
insist bool
Résultat void

PrettyPrintShutdownReport() public méthode

public PrettyPrintShutdownReport ( ) : void
Résultat void

QuiesceChannel() public méthode

Sets the channel named in the SoftProtocolException into "quiescing mode", where we issue a channel.close and ignore everything except for subsequent channel.close messages and the channel.close-ok reply that should eventually arrive.

Since a well-behaved peer will not wait indefinitely before issuing the close-ok, we don't bother with a timeout here; compare this to the case of a connection.close-ok, where a timeout is necessary.

We need to send the close method and politely wait for a reply before marking the channel as available for reuse.

As soon as SoftProtocolException is detected, we should stop servicing ordinary application work, and should concentrate on bringing down the channel as quickly and gracefully as possible. The way this is done, as per the close-protocol, is to signal closure up the stack *before* sending the channel.close, by invoking ISession.Close. Once the upper layers have been signalled, we are free to do what we need to do to clean up and shut down the channel.

public QuiesceChannel ( RabbitMQ.Client.Impl.SoftProtocolException pe ) : void
pe RabbitMQ.Client.Impl.SoftProtocolException
Résultat void

SetCloseReason() public méthode

public SetCloseReason ( RabbitMQ.Client.ShutdownEventArgs reason ) : bool
reason RabbitMQ.Client.ShutdownEventArgs
Résultat bool

StartAndTune() protected méthode

protected StartAndTune ( ) : void
Résultat void

StartHeartbeatLoop() public méthode

public StartHeartbeatLoop ( ThreadStart loop, string name, bool useBackgroundThread ) : void
loop ThreadStart
name string
useBackgroundThread bool
Résultat void

StartHeartbeatLoops() public méthode

public StartHeartbeatLoops ( bool useBackgroundThread ) : void
useBackgroundThread bool
Résultat void

StartMainLoop() public méthode

public StartMainLoop ( bool useBackgroundThread ) : void
useBackgroundThread bool
Résultat void

TerminateMainloop() public méthode

May be called more than once. Should therefore be idempotent.
public TerminateMainloop ( ) : void
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

WriteFrame() public méthode

public WriteFrame ( Frame f ) : void
f Frame
Résultat void

Property Details

HandshakeTimeout public_oe static_oe property

Timeout used while waiting for AMQP handshaking to complete (milliseconds)
public static int HandshakeTimeout
Résultat int

m_appContinuation public_oe property

public ManualResetEvent,System.Threading m_appContinuation
Résultat System.Threading.ManualResetEvent

m_callbackException public_oe property

public CallbackExceptionEventHandler m_callbackException
Résultat CallbackExceptionEventHandler

m_clientProperties public_oe property

public IDictionary m_clientProperties
Résultat object>.IDictionary

m_closeReason public_oe property

public ShutdownEventArgs,RabbitMQ.Client m_closeReason
Résultat RabbitMQ.Client.ShutdownEventArgs

m_closed public_oe property

public bool m_closed
Résultat bool

m_connectionBlocked public_oe property

public ConnectionBlockedEventHandler m_connectionBlocked
Résultat ConnectionBlockedEventHandler

m_connectionShutdown public_oe property

public ConnectionShutdownEventHandler m_connectionShutdown
Résultat ConnectionShutdownEventHandler

m_connectionUnblocked public_oe property

public ConnectionUnblockedEventHandler m_connectionUnblocked
Résultat ConnectionUnblockedEventHandler

m_eventLock public_oe property

public object m_eventLock
Résultat object

m_factory public_oe property

public ConnectionFactory,RabbitMQ.Client m_factory
Résultat RabbitMQ.Client.ConnectionFactory

m_frameHandler public_oe property

public IFrameHandler m_frameHandler
Résultat IFrameHandler

m_frameMax public_oe property

public uint m_frameMax
Résultat uint

m_heartbeat public_oe property

public ushort m_heartbeat
Résultat ushort

m_heartbeatFrame public_oe property

Heartbeat frame for transmission. Reusable across connections.
public Frame,RabbitMQ.Client.Impl m_heartbeatFrame
Résultat Frame

m_heartbeatRead public_oe property

public AutoResetEvent,System.Threading m_heartbeatRead
Résultat System.Threading.AutoResetEvent

m_heartbeatWrite public_oe property

public AutoResetEvent,System.Threading m_heartbeatWrite
Résultat System.Threading.AutoResetEvent

m_id public_oe property

public Guid,System m_id
Résultat System.Guid

m_knownHosts public_oe property

public AmqpTcpEndpoint[],RabbitMQ.Client m_knownHosts
Résultat RabbitMQ.Client.AmqpTcpEndpoint[]

m_missedHeartbeats public_oe property

public int m_missedHeartbeats
Résultat int

m_model0 public_oe property

public ModelBase,RabbitMQ.Client.Impl m_model0
Résultat ModelBase

m_running public_oe property

public bool m_running
Résultat bool

m_serverProperties public_oe property

public IDictionary m_serverProperties
Résultat object>.IDictionary

m_session0 public_oe property

public MainSession,RabbitMQ.Client.Impl m_session0
Résultat RabbitMQ.Client.Impl.MainSession

m_sessionManager public_oe property

public SessionManager,RabbitMQ.Client.Impl m_sessionManager
Résultat RabbitMQ.Client.Impl.SessionManager

m_shutdownReport public_oe property

public IList m_shutdownReport
Résultat IList