コード例 #1
0
        public IConnection GetConnection(ConnectionPurpose purpose)
        {
            //note: The purpose is there so that we/users can add more advanced connection managers in the future

            lock (connectionFactory)
            {
                if (connectionFailed)
                    throw connectionFailedReason;

                return connection ?? (connection = new PersistentConnection(connectionFactory, connectionConfiguration.RetryDelay));
            }
        }
コード例 #2
0
        public IConnection GetConnection(ConnectionPurpose purpose)
        {
            //note: The purpose is there so that we/users can add more advanced connection managers in the future

            lock (connectionFactory)
            {
                if (connectionFailed)
                {
                    throw connectionFailedReason;
                }

                return(connection ?? (connection = new PersistentConnection(connectionFactory, connectionConfiguration.RetryDelay)));
            }
        }
コード例 #3
0
 public static byte[] GetConnectionPurposeBytes(ConnectionPurpose p)
 => BitConverter.GetBytes(GetConnectionPurposeCode(p));
コード例 #4
0
 public static ushort GetConnectionPurposeCode(ConnectionPurpose p)
 => (ushort)p;