Esempio n. 1
0
        public static Task <Connection> GetConnectionAsync(this IObjectPrx prx,
                                                           IProgress <bool>?progress = null,
                                                           CancellationToken cancel  = new CancellationToken())
        {
            var completed = new GetConnectionTaskCompletionCallback(progress, cancel);

            IceI_getConnection(prx, completed, false);
            return(completed.Task);
        }
Esempio n. 2
0
 /// <summary>
 /// Returns the Connection for this proxy. If the proxy does not yet have an established connection,
 /// it first attempts to create a connection.
 /// </summary>
 /// <returns>The Connection for this proxy.</returns>
 /// <exception name="CollocationOptimizationException">If the proxy uses collocation optimization and denotes a
 /// collocated object.</exception>
 public static Connection GetConnection(this IObjectPrx prx)
 {
     try
     {
         var completed = new GetConnectionTaskCompletionCallback();
         IceI_getConnection(prx, completed, true);
         return(completed.Task.Result);
     }
     catch (AggregateException ex)
     {
         throw ex.InnerException;
     }
 }