public ConnectionBase(ConnectionParameters parameters, bool insist, IFrameHandler frameHandler) { m_parameters = parameters; m_frameHandler = frameHandler; m_sessionManager = new SessionManager(this); m_session0 = new MainSession(this); m_session0.Handler = new MainSession.SessionCloseDelegate(NotifyReceivedCloseOk); m_model0 = (ModelBase)Protocol.CreateModel(m_session0); StartMainLoop(); Open(insist); StartHeartbeatLoops(); }
public ConnectionBase(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) { m_factory = factory; m_frameHandler = frameHandler; m_sessionManager = new SessionManager(this, 0); m_session0 = new MainSession(this); m_session0.Handler = new MainSession.SessionCloseDelegate(NotifyReceivedCloseOk); m_model0 = (ModelBase)Protocol.CreateModel(m_session0); StartMainLoop(); Open(insist); StartHeartbeatLoops(); AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload; }
public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHandler, string clientProvidedName = null) { ClientProvidedName = clientProvidedName; KnownHosts = null; FrameMax = 0; m_factory = factory; m_frameHandler = frameHandler; ConsumerWorkService = new ConsumerWorkService(); m_sessionManager = new SessionManager(this, 0); m_session0 = new MainSession(this) { Handler = NotifyReceivedCloseOk }; m_model0 = (ModelBase)Protocol.CreateModel(m_session0); StartMainLoop(factory.UseBackgroundThreadsForIO); Open(insist); }
public Connection(IConnectionFactory factory, bool insist, IFrameHandler frameHandler) { KnownHosts = null; FrameMax = 0; m_factory = factory; m_frameHandler = frameHandler; this.ConsumerWorkService = new ConsumerWorkService(factory.TaskScheduler); m_sessionManager = new SessionManager(this, 0); m_session0 = new MainSession(this) { Handler = NotifyReceivedCloseOk }; m_model0 = (ModelBase)Protocol.CreateModel(m_session0); StartMainLoop(factory.UseBackgroundThreadsForIO); Open(insist); #if NETFX_CORE #pragma warning disable 0168 try { Windows.UI.Xaml.Application.Current.Suspending += this.HandleApplicationSuspend; } catch (Exception ex) { // If called from a desktop app (i.e. unit tests), then there is no current application } #pragma warning restore 0168 #else AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload; #endif }