public QuiescingSession(Connection connection, int channelNumber, ShutdownEventArgs reason) : base(connection, channelNumber) { m_reason = reason; }
public QuiescingSession(RabbitMQ.Client.Framing.Impl.Connection connection, int channelNumber, ShutdownEventArgs reason) : base(connection, channelNumber) { m_reason = reason; }
public MainSession(Connection connection) : base(connection, 0) { Command request; connection.Protocol.CreateConnectionClose(0, "", out request, out m_closeOkClassId, out m_closeOkMethodId); m_closeClassId = request.Method.ProtocolClassId; m_closeMethodId = request.Method.ProtocolMethodId; }
public SessionBase(Connection connection, int channelNumber) { CloseReason = null; Connection = connection; ChannelNumber = channelNumber; if (channelNumber != 0) { connection.ConnectionShutdown += OnConnectionShutdown; } }
protected bool RecoverConnectionDelegate() { while (!ManuallyClosed) { try { var fh = endpoints.SelectOne(m_factory.CreateFrameHandler); m_delegate = new Connection(m_factory, false, fh, this.ClientProvidedName); return true; } catch (Exception e) { ESLog.Error("Connection recovery exception.", e); // Trigger recovery error events var handler = m_connectionRecoveryError; if (handler != null) { var args = new ConnectionRecoveryErrorEventArgs(e); foreach (EventHandler<ConnectionRecoveryErrorEventArgs> h in handler.GetInvocationList()) { try { h(this, args); } catch (Exception ex) { var a = new CallbackExceptionEventArgs(ex); a.Detail["context"] = "OnConnectionRecoveryError"; m_delegate.OnCallbackException(a); } } } #if NETFX_CORE System.Threading.Tasks.Task.Delay(m_factory.NetworkRecoveryInterval).Wait(); #else Thread.Sleep(m_factory.NetworkRecoveryInterval); #endif } } return false; }
private void Init(IFrameHandler fh) { m_delegate = new Connection(m_factory, false, fh, this.ClientProvidedName); AutorecoveringConnection self = this; EventHandler<ShutdownEventArgs> recoveryListener = (_, args) => { lock (recoveryLockTarget) { if (ShouldTriggerConnectionRecovery(args)) { try { self.BeginAutomaticRecovery(); } catch (Exception e) { ESLog.Error("BeginAutomaticRecovery() failed.", e); } } } }; lock (m_eventLock) { ConnectionShutdown += recoveryListener; if (!m_recordedShutdownEventHandlers.Contains(recoveryListener)) { m_recordedShutdownEventHandlers.Add(recoveryListener); } } }
public SessionManager(Connection connection, ushort channelMax) { m_connection = connection; ChannelMax = (channelMax == 0) ? ushort.MaxValue : channelMax; Ints = new IntAllocator(1, ChannelMax); }
public Session(Connection connection, int channelNumber) : base(connection, channelNumber) { m_assembler = new CommandAssembler(connection.Protocol); }