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)); } }
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))); } }
public static byte[] GetConnectionPurposeBytes(ConnectionPurpose p) => BitConverter.GetBytes(GetConnectionPurposeCode(p));
public static ushort GetConnectionPurposeCode(ConnectionPurpose p) => (ushort)p;