コード例 #1
0
 /// <summary>
 /// Closes connections to every Bob node in cluster
 /// </summary>
 /// <param name="mode">Mode that contols close error handling</param>
 /// <exception cref="BobOperationException">Error during connection shutdown</exception>
 public void Close(BobClusterOpenCloseMode mode)
 {
     for (int i = 0; i < _clients.Length; i++)
     {
         try
         {
             _clients[i].Close();
         }
         catch (BobOperationException)
         {
             if (mode == BobClusterOpenCloseMode.ThrowOnFirstError)
             {
                 throw;
             }
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Closes connections to every Bob node in cluster
 /// </summary>
 /// <param name="mode">Mode that contols close error handling</param>
 /// <returns>Task to await</returns>
 /// <exception cref="BobOperationException">Error during connection shutdown</exception>
 public async Task CloseAsync(BobClusterOpenCloseMode mode)
 {
     for (int i = 0; i < _clients.Length; i++)
     {
         try
         {
             await _clients[i].CloseAsync().ConfigureAwait(false);
         }
         catch (BobOperationException)
         {
             if (mode == BobClusterOpenCloseMode.ThrowOnFirstError)
             {
                 throw;
             }
         }
     }
 }
コード例 #3
0
 /// <summary>
 /// Closes connections to every Bob node in cluster
 /// </summary>
 /// <param name="mode">Mode that contols close error handling</param>
 /// <returns>Task to await</returns>
 /// <exception cref="BobOperationException">Error during connection shutdown</exception>
 public Task CloseAsync(BobClusterOpenCloseMode mode)
 {
     return(_innerCluster.CloseAsync(mode));
 }
コード例 #4
0
 /// <summary>
 /// Closes connections to every Bob node in cluster
 /// </summary>
 /// <param name="mode">Mode that contols close error handling</param>
 /// <exception cref="BobOperationException">Error during connection shutdown</exception>
 public void Close(BobClusterOpenCloseMode mode)
 {
     _innerCluster.Close(mode);
 }
コード例 #5
0
 /// <summary>
 /// Explicitly opens connection to every Bob node in cluster
 /// </summary>
 /// <param name="mode">Mode that contols open error handling</param>
 /// <exception cref="BobOperationException">Connection was not opened</exception>
 /// <exception cref="TimeoutException">Specified timeout reached</exception>
 /// <exception cref="ObjectDisposedException">Client was disposed</exception>
 public void Open(BobClusterOpenCloseMode mode)
 {
     _innerCluster.Open(mode);
 }