Init() public method

public Init ( ) : void
return void
        public IConnection CreateConnection(ConnectionFactory factory,
                                            IFrameHandler frameHandler,
                                            bool automaticRecoveryEnabled)
        {
            var ac = new AutorecoveringConnection(factory, null);

            ac.Init();
            return(ac);
        }
Esempio n. 2
0
        public IConnection CreateConnection(
            ConnectionFactory factory,
            string clientProvidedName)
        {
            var ac = new AutorecoveringConnection(factory, clientProvidedName);

            ac.Init();
            return(ac);
        }
Esempio n. 3
0
        public IConnection CreateConnection(ConnectionFactory factory,
                                            IFrameHandler frameHandler,
                                            bool automaticRecoveryEnabled,
                                            string clientProvidedName)
        {
            var ac = new AutorecoveringConnection(factory, clientProvidedName);

            ac.Init();
            return(ac);
        }
 /// <summary>
 /// Create a connection using a list of hostnames. The first reachable
 /// hostname will be used initially. Subsequent hostname picks are determined
 /// by the <see cref="IHostnameSelector" /> configured.
 /// </summary>
 /// <param name="hostnames">
 /// List of hostnames to use for the initial
 /// connection and recovery.
 /// </param>
 /// <returns>Open connection</returns>
 /// <exception cref="BrokerUnreachableException">
 /// When no hostname was reachable.
 /// </exception>
 public IConnection CreateConnection(IList<string> hostnames)
 {
     IConnection conn;
     try
     {
         if (AutomaticRecoveryEnabled)
         {
             var autorecoveringConnection = new AutorecoveringConnection(this);
             autorecoveringConnection.Init(hostnames);
             conn = autorecoveringConnection;
         }
         else
         {
             IProtocol protocol = Protocols.DefaultProtocol;
             conn = protocol.CreateConnection(this, false, CreateFrameHandler());
         }
     }
     catch (Exception e)
     {
         throw new BrokerUnreachableException(e);
     }
     return conn;
 }
 public IConnection CreateConnection(ConnectionFactory factory,
     IFrameHandler frameHandler,
     bool automaticRecoveryEnabled,
     string clientProvidedName)
 {
     var ac = new AutorecoveringConnection(factory, clientProvidedName);
     ac.Init();
     return ac;
 }
 public IConnection CreateConnection(ConnectionFactory factory,
     IFrameHandler frameHandler,
     bool automaticRecoveryEnabled)
 {
     var ac = new AutorecoveringConnection(factory, null);
     ac.Init();
     return ac;
 }