< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.ServiceChannelProxy
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/ServiceChannelProxy.cs
Line coverage
28%
Covered lines: 67
Uncovered lines: 172
Coverable lines: 239
Total lines: 715
Line coverage: 28%
Branch coverage
35%
Covered branches: 20
Total branches: 56
Branch coverage: 35.7%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
CreateProxy(...)50%2288.88%
ToString()100%110%
GetMethodData(...)50%181858.33%
GetServiceChannel()100%11100%
Invoke(...)25%121242.85%
CreateTask(...)0%220%
CreateGenericTask(...)0%440%
CreateTask(...)0%440%
.ctor(...)100%110%
TrySetResult(...)100%110%
TrySetException(...)100%110%
TrySetCanceled()100%110%
.cctor()100%110%
.ctor(...)100%110%
GetTaskCompletionSourceInfo(...)100%110%
InvokeTaskService(...)100%110%
InvokeChannel(...)100%110%
InvokeGetType(...)100%110%
InvokeBeginService(...)100%110%
InvokeEndService(...)100%110%
InvokeService(...)100%11100%
ExecuteMessage(...)100%110%
.ctor()100%11100%
TryGetMethodData(...)50%2277.77%
FindMethod(...)50%6666.66%
SetMethodData(...)50%6661.53%
.ctor(...)100%110%
.ctor(...)100%11100%
CoreWCF.Channels.IChannel.GetProperty()100%110%
CoreWCF.ICommunicationObject.add_Closed(...)100%11100%
CoreWCF.ICommunicationObject.remove_Closed(...)100%11100%
CoreWCF.ICommunicationObject.add_Closing(...)100%110%
CoreWCF.ICommunicationObject.remove_Closing(...)100%110%
CoreWCF.ICommunicationObject.add_Faulted(...)100%110%
CoreWCF.ICommunicationObject.remove_Faulted(...)100%110%
CoreWCF.ICommunicationObject.add_Opened(...)100%110%
CoreWCF.ICommunicationObject.remove_Opened(...)100%110%
CoreWCF.ICommunicationObject.add_Opening(...)100%110%
CoreWCF.ICommunicationObject.remove_Opening(...)100%110%
CoreWCF.ICommunicationObject.Abort()100%110%
CoreWCF.ICommunicationObject.CloseAsync()100%110%
CoreWCF.ICommunicationObject.CloseAsync(...)100%110%
CoreWCF.ICommunicationObject.OpenAsync()100%110%
CoreWCF.ICommunicationObject.OpenAsync(...)100%110%
CoreWCF.IClientChannel.add_UnknownMessageReceived(...)100%110%
CoreWCF.IClientChannel.remove_UnknownMessageReceived(...)100%110%
System.IDisposable.Dispose()100%110%
CoreWCF.Channels.IOutputChannel.SendAsync(...)100%110%
CoreWCF.Channels.IOutputChannel.SendAsync(...)100%110%
CoreWCF.Channels.IRequestChannel.RequestAsync(...)100%110%
CoreWCF.Channels.IRequestChannel.RequestAsync(...)100%110%
CoreWCF.IDuplexContextChannel.CloseOutputSessionAsync(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/ServiceChannelProxy.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.Concurrent;
 6using System.ComponentModel;
 7using System.Diagnostics.Contracts;
 8using System.Globalization;
 9using System.Reflection;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using CoreWCF.Configuration;
 13using CoreWCF.Description;
 14using CoreWCF.Dispatcher;
 15using CoreWCF.Runtime;
 16
 17namespace CoreWCF.Channels
 18{
 19    [Browsable(false)]
 20    [EditorBrowsable(EditorBrowsableState.Never)]
 21    [Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your cod
 22    public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IR
 23    {
 24        private const string activityIdSlotName = "E2ETrace.ActivityID";
 25        private Type _proxiedType;
 26        private ServiceChannel _serviceChannel;
 27        private ImmutableClientRuntime _proxyRuntime;
 28        private MethodDataCache _methodDataCache;
 29
 30        // ServiceChannelProxy serves 2 roles.  It is the TChannel proxy called by the client,
 31        // and it is also the handler of those calls that dispatches them to the appropriate service channel.
 32        // In .Net Remoting terms, it is conceptually the same as a RealProxy and a TransparentProxy combined.
 33        internal static TChannel CreateProxy<TChannel>(MessageDirection direction, ServiceChannel serviceChannel)
 34        {
 135            TChannel proxy = Create<TChannel, ServiceChannelProxy>();
 136            if (proxy == null)
 37            {
 038                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Fai
 39            }
 40
 141            ServiceChannelProxy channelProxy = (ServiceChannelProxy)(object)proxy;
 142            channelProxy._proxiedType = typeof(TChannel);
 143            channelProxy._serviceChannel = serviceChannel;
 144            channelProxy._proxyRuntime = serviceChannel.ClientRuntime.GetRuntime();
 145            channelProxy._methodDataCache = new MethodDataCache();
 146            return proxy;
 47        }
 48
 49        //Workaround is to set the activityid in remoting call's LogicalCallContext
 50
 51        // Override ToString() to reveal only the expected proxy type, not the generated one
 52        public sealed override string ToString()
 53        {
 054            return _proxiedType.ToString();
 55        }
 56
 57        private MethodData GetMethodData(MethodCall methodCall)
 58        {
 159            MethodBase method = methodCall.MethodBase;
 160            if (_methodDataCache.TryGetMethodData(method, out MethodData methodData))
 61            {
 062                return methodData;
 63            }
 64
 65            bool canCacheMessageData;
 66
 167            Type declaringType = method.DeclaringType;
 168            if (declaringType == typeof(object) && method == typeof(object).GetMethod("GetType"))
 69            {
 070                canCacheMessageData = true;
 071                methodData = new MethodData(method, MethodType.GetType);
 72            }
 173            else if (declaringType.IsAssignableFrom(_serviceChannel.GetType()))
 74            {
 075                canCacheMessageData = true;
 076                methodData = new MethodData(method, MethodType.Channel);
 77            }
 78            else
 79            {
 180                ProxyOperationRuntime operation = _proxyRuntime.GetOperation(method, methodCall.Args, out canCacheMessag
 81
 182                if (operation == null)
 83                {
 084                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.Format(SR.SFx
 85                }
 86
 87                MethodType methodType;
 88
 189                if (operation.IsTaskCall(methodCall))
 90                {
 091                    methodType = MethodType.TaskService;
 92                }
 193                else if (operation.IsSyncCall(methodCall))
 94                {
 195                    methodType = MethodType.Service;
 96                }
 097                else if (operation.IsBeginCall(methodCall))
 98                {
 099                    methodType = MethodType.BeginService;
 100                }
 101                else
 102                {
 0103                    methodType = MethodType.EndService;
 104                }
 105
 1106                methodData = new MethodData(method, methodType, operation);
 107            }
 108
 1109            if (canCacheMessageData)
 110            {
 1111                _methodDataCache.SetMethodData(methodData);
 112            }
 113
 1114            return methodData;
 115        }
 116
 117        internal ServiceChannel GetServiceChannel()
 118        {
 2119            return _serviceChannel;
 120        }
 121
 122        protected sealed override object Invoke(MethodInfo targetMethod, object[] args)
 123        {
 1124            if (args == null)
 125            {
 0126                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(args));
 127            }
 128
 1129            if (targetMethod == null)
 130            {
 0131                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.Inv
 132            }
 133
 1134            MethodCall methodCall = new MethodCall(targetMethod, args);
 1135            MethodData methodData = GetMethodData(methodCall);
 136
 1137            switch (methodData.MethodType)
 138            {
 139                case MethodType.Service:
 1140                    return InvokeService(methodCall, methodData.Operation);
 141                case MethodType.BeginService:
 0142                    return InvokeBeginService(methodCall, methodData.Operation);
 143                case MethodType.EndService:
 0144                    return InvokeEndService(methodCall, methodData.Operation);
 145                case MethodType.TaskService:
 0146                    return InvokeTaskService(methodCall, methodData.Operation);
 147                case MethodType.Channel:
 0148                    return InvokeChannel(methodCall);
 149                case MethodType.GetType:
 0150                    return InvokeGetType(methodCall);
 151                default:
 152                    Fx.Assert("Invalid proxy method type");
 0153                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Forma
 154            }
 155        }
 156
 157        internal static class TaskCreator
 158        {
 159            public static Task CreateTask(ServiceChannel channel, MethodCall methodCall, ProxyOperationRuntime operation
 160            {
 0161                if (operation.TaskTResult == ServiceReflector.VoidType)
 162                {
 0163                    return CreateTask(channel, operation, methodCall.Args);
 164                }
 0165                return CreateGenericTask(channel, operation, methodCall.Args);
 166            }
 167
 168            private static Task CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inpu
 169            {
 0170                TaskCompletionSourceProxy tcsp = new TaskCompletionSourceProxy(operation.TaskTResult);
 0171                Action<Task<object>, object> completeCallDelegate = (antecedent, obj) =>
 0172                {
 0173                    var tcsProxy = obj as TaskCompletionSourceProxy;
 0174                    Contract.Assert(tcsProxy != null);
 0175                    if (antecedent.IsFaulted)
 0176                    {
 0177                        tcsProxy.TrySetException(antecedent.Exception.InnerException);
 0178                    }
 0179                    else if (antecedent.IsCanceled)
 0180                    {
 0181                        tcsProxy.TrySetCanceled();
 0182                    }
 0183                    else
 0184                    {
 0185                        tcsProxy.TrySetResult(antecedent.Result);
 0186                    }
 0187                };
 188
 189                try
 190                {
 0191                    channel.CallAsync(operation.Action, operation.IsOneWay, operation, inputParameters,
 0192                    Array.Empty<object>()).ContinueWith(completeCallDelegate, tcsp);
 0193                }
 194#pragma warning disable CA1031 // Do not catch general exception types - copying all exceptions to TaskCompeletionSource
 0195                catch (Exception e)
 196                {
 0197                    tcsp.TrySetException(e);
 0198                }
 199#pragma warning restore CA1031 // Do not catch general exception types
 200
 0201                return tcsp.Task;
 202            }
 203
 204            private static Task CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, object[] inputParame
 205            {
 0206                TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
 207
 0208                Action<Task<object>, object> completeCallDelegate = (antecedent, obj) =>
 0209                {
 0210                    var tcsObj = obj as TaskCompletionSource<object>;
 0211                    Contract.Assert(tcsObj != null);
 0212                    if (antecedent.IsFaulted)
 0213                    {
 0214                        tcsObj.TrySetException(antecedent.Exception.InnerException);
 0215                    }
 0216                    else if (antecedent.IsCanceled)
 0217                    {
 0218                        tcsObj.TrySetCanceled();
 0219                    }
 0220                    else
 0221                    {
 0222                        tcsObj.TrySetResult(antecedent.Result);
 0223                    }
 0224                };
 225
 226
 227                try
 228                {
 0229                    channel.CallAsync(operation.Action, operation.IsOneWay, operation, inputParameters,
 0230                        Array.Empty<object>()).ContinueWith(completeCallDelegate, tcs);
 0231                }
 232#pragma warning disable CA1031 // Do not catch general exception types - copying all exceptions to TaskCompeletionSource
 233
 0234                catch (Exception e)
 235                {
 0236                    tcs.TrySetException(e);
 0237                }
 238#pragma warning restore CA1031 // Do not catch general exception types
 239
 0240                return tcs.Task;
 241            }
 242        }
 243
 244        private class TaskCompletionSourceProxy
 245        {
 246            private readonly TaskCompletionSourceInfo _tcsInfo;
 247            private readonly object _tcsInstance;
 248
 0249            public TaskCompletionSourceProxy(Type resultType)
 250            {
 0251                _tcsInfo = TaskCompletionSourceInfo.GetTaskCompletionSourceInfo(resultType);
 0252                _tcsInstance = Activator.CreateInstance(_tcsInfo.GenericType);
 0253            }
 254
 0255            public Task Task { get { return (Task)_tcsInfo.TaskProperty.GetValue(_tcsInstance); } }
 256
 257            public bool TrySetResult(object result)
 258            {
 0259                return (bool)_tcsInfo.TrySetResultMethod.Invoke(_tcsInstance, new object[] { result });
 260            }
 261
 262            public bool TrySetException(Exception exception)
 263            {
 0264                return (bool)_tcsInfo.TrySetExceptionMethod.Invoke(_tcsInstance, new object[] { exception });
 265            }
 266
 267            public bool TrySetCanceled()
 268            {
 0269                return (bool)_tcsInfo.TrySetCanceledMethod.Invoke(_tcsInstance, Array.Empty<object>());
 270            }
 271        }
 272
 273        private class TaskCompletionSourceInfo
 274        {
 0275            private static readonly ConcurrentDictionary<Type, TaskCompletionSourceInfo> s_cache = new ConcurrentDiction
 276
 0277            public TaskCompletionSourceInfo(Type resultType)
 278            {
 0279                ResultType = resultType;
 0280                Type tcsType = typeof(TaskCompletionSource<>);
 0281                GenericType = tcsType.MakeGenericType(new Type[] { resultType });
 0282                TaskProperty = GenericType.GetTypeInfo().GetDeclaredProperty("Task");
 0283                TrySetResultMethod = GenericType.GetTypeInfo().GetDeclaredMethod("TrySetResult");
 0284                TrySetExceptionMethod = GenericType.GetRuntimeMethod("TrySetException", new Type[] { typeof(Exception) }
 0285                TrySetCanceledMethod = GenericType.GetRuntimeMethod("TrySetCanceled", Array.Empty<Type>());
 0286            }
 287
 0288            public Type ResultType { get; private set; }
 0289            public Type GenericType { get; private set; }
 0290            public PropertyInfo TaskProperty { get; private set; }
 0291            public MethodInfo TrySetResultMethod { get; private set; }
 0292            public MethodInfo TrySetExceptionMethod { get; set; }
 0293            public MethodInfo TrySetCanceledMethod { get; set; }
 294
 295            public static TaskCompletionSourceInfo GetTaskCompletionSourceInfo(Type resultType)
 296            {
 0297                return s_cache.GetOrAdd(resultType, t => new TaskCompletionSourceInfo(t));
 298            }
 299        }
 300
 301        private object InvokeTaskService(MethodCall methodCall, ProxyOperationRuntime operation)
 302        {
 0303            Task task = TaskCreator.CreateTask(_serviceChannel, methodCall, operation);
 0304            return task;
 305        }
 306
 307        private object InvokeChannel(MethodCall methodCall)
 308        {
 309            //string activityName = null;
 310            //ActivityType activityType = ActivityType.Unknown;
 311            //if (DiagnosticUtility.ShouldUseActivity)
 312            //{
 313            //    if (ServiceModelActivity.Current == null ||
 314            //        ServiceModelActivity.Current.ActivityType != ActivityType.Close)
 315            //    {
 316            //        MethodData methodData = this.GetMethodData(methodCall);
 317            //        if (methodData.MethodBase.DeclaringType == typeof(System.ServiceModel.ICommunicationObject)
 318            //            && methodData.MethodBase.Name.Equals("Close", StringComparison.Ordinal))
 319            //        {
 320            //            activityName = SR.Format(SR.ActivityClose, _serviceChannel.GetType().FullName);
 321            //            activityType = ActivityType.Close;
 322            //        }
 323            //    }
 324            //}
 325
 326            //using (ServiceModelActivity activity = string.IsNullOrEmpty(activityName) ? null : ServiceModelActivity.Cr
 327            //{
 328            //    if (DiagnosticUtility.ShouldUseActivity)
 329            //    {
 330            //        ServiceModelActivity.Start(activity, activityName, activityType);
 331            //    }
 0332            return ExecuteMessage(_serviceChannel, methodCall);
 333            //}
 334        }
 335
 336        private object InvokeGetType(MethodCall methodCall)
 337        {
 0338            return _proxiedType;
 339        }
 340
 341        private object InvokeBeginService(MethodCall methodCall, ProxyOperationRuntime operation)
 342        {
 0343            object[] ins = operation.MapAsyncBeginInputs(methodCall, out AsyncCallback callback, out object asyncState);
 0344            object ret = _serviceChannel.BeginCall(operation.Action, operation.IsOneWay, operation, ins, callback, async
 0345            return ret;
 346        }
 347
 348        private object InvokeEndService(MethodCall methodCall, ProxyOperationRuntime operation)
 349        {
 0350            operation.MapAsyncEndInputs(methodCall, out IAsyncResult result, out object[] outs);
 0351            object ret = _serviceChannel.EndCall(operation.Action, outs, result);
 0352            operation.MapAsyncOutputs(methodCall, outs, ref ret);
 0353            return ret;
 354        }
 355
 356        private object InvokeService(MethodCall methodCall, ProxyOperationRuntime operation)
 357        {
 1358            object[] ins = operation.MapSyncInputs(methodCall, out object[] outs);
 359            object ret;
 1360            using (TaskHelpers.RunTaskContinuationsOnOurThreads())
 361            {
 1362                ret = _serviceChannel.CallAsync(operation.Action, operation.IsOneWay, operation, ins, outs).GetAwaiter()
 1363            }
 1364            operation.MapSyncOutputs(methodCall, outs, ref ret);
 1365            return ret;
 366        }
 367
 368        private object ExecuteMessage(object target, MethodCall methodCall)
 369        {
 0370            MethodBase targetMethod = methodCall.MethodBase;
 371
 0372            object[] args = methodCall.Args;
 373            object returnValue;
 374            try
 375            {
 0376                returnValue = targetMethod.Invoke(target, args);
 0377            }
 378            catch (TargetInvocationException e)
 379            {
 0380                throw e.InnerException;
 381            }
 382
 0383            return returnValue;
 384        }
 385
 386        internal class MethodDataCache
 387        {
 388            private MethodData[] _methodDatas;
 389
 1390            public MethodDataCache()
 391            {
 1392                _methodDatas = new MethodData[4];
 1393            }
 394
 395            private object ThisLock
 396            {
 2397                get { return this; }
 398            }
 399
 400            public bool TryGetMethodData(MethodBase method, out MethodData methodData)
 401            {
 1402                lock (ThisLock)
 403                {
 1404                    MethodData[] methodDatas = _methodDatas;
 1405                    int index = FindMethod(methodDatas, method);
 1406                    if (index >= 0)
 407                    {
 0408                        methodData = methodDatas[index];
 0409                        return true;
 410                    }
 411                    else
 412                    {
 1413                        methodData = new MethodData();
 1414                        return false;
 415                    }
 416                }
 1417            }
 418
 419            private static int FindMethod(MethodData[] methodDatas, MethodBase methodToFind)
 420            {
 4421                for (int i = 0; i < methodDatas.Length; i++)
 422                {
 2423                    MethodBase method = methodDatas[i].MethodBase;
 2424                    if (method == null)
 425                    {
 426                        break;
 427                    }
 0428                    if (method == methodToFind)
 429                    {
 0430                        return i;
 431                    }
 432                }
 2433                return -1;
 434            }
 435
 436            public void SetMethodData(MethodData methodData)
 437            {
 1438                lock (ThisLock)
 439                {
 1440                    int index = FindMethod(_methodDatas, methodData.MethodBase);
 1441                    if (index < 0)
 442                    {
 2443                        for (int i = 0; i < _methodDatas.Length; i++)
 444                        {
 1445                            if (_methodDatas[i].MethodBase == null)
 446                            {
 1447                                _methodDatas[i] = methodData;
 1448                                return;
 449                            }
 450                        }
 0451                        MethodData[] newMethodDatas = new MethodData[_methodDatas.Length * 2];
 0452                        Array.Copy(_methodDatas, newMethodDatas, _methodDatas.Length);
 0453                        newMethodDatas[_methodDatas.Length] = methodData;
 0454                        _methodDatas = newMethodDatas;
 455                    }
 0456                }
 1457            }
 458        }
 459
 460        internal enum MethodType
 461        {
 462            Service,
 463            BeginService,
 464            EndService,
 465            Channel,
 466            Object,
 467            GetType,
 468            TaskService
 469        }
 470
 471        internal struct MethodData
 472        {
 473            public MethodData(MethodBase methodBase, MethodType methodType)
 0474                : this(methodBase, methodType, null)
 475            {
 0476            }
 477
 478            public MethodData(MethodBase methodBase, MethodType methodType, ProxyOperationRuntime operation)
 479            {
 1480                MethodBase = methodBase;
 1481                MethodType = methodType;
 1482                Operation = operation;
 1483            }
 484
 4485            public MethodBase MethodBase { get; }
 486
 1487            public MethodType MethodType { get; }
 488
 1489            public ProxyOperationRuntime Operation { get; }
 490        }
 491
 492        #region Channel interfaces
 493        // These channel methods exist only to implement additional channel interfaces for ServiceChannelProxy.
 494        // This is required because clients can down-cast typed proxies to the these channel interfaces.
 495        // On the desktop, the .Net Remoting layer allowed that type cast, and subsequent calls against the
 496        // interface went back through the RealProxy and invoked the underlying ServiceChannel.
 497        // Net Native and CoreClr do not have .Net Remoting and therefore cannot use that mechanism.
 498        // But because typed proxies derive from ServiceChannelProxy, implementing these interfaces
 499        // on ServiceChannelProxy permits casting the typed proxy to these interfaces.
 500        // All interface implementations delegate directly to the underlying ServiceChannel.
 501        T IChannel.GetProperty<T>()
 502        {
 0503            return _serviceChannel.GetProperty<T>();
 504        }
 505
 506        CommunicationState ICommunicationObject.State
 507        {
 0508            get { return _serviceChannel.State; }
 509        }
 510
 511        event EventHandler ICommunicationObject.Closed
 512        {
 4513            add { _serviceChannel.Closed += value; }
 4514            remove { _serviceChannel.Closed -= value; }
 515        }
 516
 517        event EventHandler ICommunicationObject.Closing
 518        {
 0519            add { _serviceChannel.Closing += value; }
 0520            remove { _serviceChannel.Closing -= value; }
 521        }
 522
 523        event EventHandler ICommunicationObject.Faulted
 524        {
 0525            add { _serviceChannel.Faulted += value; }
 0526            remove { _serviceChannel.Faulted -= value; }
 527        }
 528
 529        event EventHandler ICommunicationObject.Opened
 530        {
 0531            add { _serviceChannel.Opened += value; }
 0532            remove { _serviceChannel.Opened -= value; }
 533        }
 534
 535        event EventHandler ICommunicationObject.Opening
 536        {
 0537            add { _serviceChannel.Opening += value; }
 0538            remove { _serviceChannel.Opening -= value; }
 539        }
 540
 541        void ICommunicationObject.Abort()
 542        {
 0543            _serviceChannel.Abort();
 0544        }
 545
 546        Task ICommunicationObject.CloseAsync()
 547        {
 0548            return _serviceChannel.CloseAsync();
 549        }
 550
 551        Task ICommunicationObject.CloseAsync(CancellationToken token)
 552        {
 0553            return _serviceChannel.CloseAsync(token);
 554        }
 555
 556        Task ICommunicationObject.OpenAsync()
 557        {
 0558            return _serviceChannel.OpenAsync();
 559        }
 560
 561        Task ICommunicationObject.OpenAsync(CancellationToken token)
 562        {
 0563            return _serviceChannel.OpenAsync(token);
 564        }
 565
 566        //Uri IClientChannel.Via
 567        //{
 568        //    get { return _serviceChannel.Via; }
 569        //}
 570
 571        event EventHandler<UnknownMessageReceivedEventArgs> IClientChannel.UnknownMessageReceived
 572        {
 0573            add { ((IClientChannel)_serviceChannel).UnknownMessageReceived += value; }
 0574            remove { ((IClientChannel)_serviceChannel).UnknownMessageReceived -= value; }
 575        }
 576
 577        void IDisposable.Dispose()
 578        {
 0579            ((IClientChannel)_serviceChannel).Dispose();
 0580        }
 581
 582        //bool IContextChannel.AllowOutputBatching
 583        //{
 584        //    get
 585        //    {
 586        //        return ((IContextChannel)_serviceChannel).AllowOutputBatching;
 587        //    }
 588        //    set
 589        //    {
 590        //        ((IContextChannel)_serviceChannel).AllowOutputBatching = value;
 591        //    }
 592        //}
 593
 594        IInputSession IContextChannel.InputSession
 595        {
 0596            get { return ((IContextChannel)_serviceChannel).InputSession; }
 597        }
 598
 599        EndpointAddress IContextChannel.LocalAddress
 600        {
 0601            get { return ((IContextChannel)_serviceChannel).LocalAddress; }
 602        }
 603
 604        TimeSpan IContextChannel.OperationTimeout
 605        {
 606            get
 607            {
 0608                return ((IContextChannel)_serviceChannel).OperationTimeout;
 609            }
 610            set
 611            {
 0612                ((IContextChannel)_serviceChannel).OperationTimeout = value;
 0613            }
 614        }
 615
 616        IOutputSession IContextChannel.OutputSession
 617        {
 0618            get { return ((IContextChannel)_serviceChannel).OutputSession; }
 619        }
 620
 621        EndpointAddress IOutputChannel.RemoteAddress
 622        {
 0623            get { return ((IContextChannel)_serviceChannel).RemoteAddress; }
 624        }
 625
 626        Uri IOutputChannel.Via
 627        {
 0628            get { return _serviceChannel.Via; }
 629        }
 630
 631        EndpointAddress IContextChannel.RemoteAddress
 632        {
 0633            get { return ((IContextChannel)_serviceChannel).RemoteAddress; }
 634        }
 635
 636        string IContextChannel.SessionId
 637        {
 0638            get { return ((IContextChannel)_serviceChannel).SessionId; }
 639        }
 640
 641        IExtensionCollection<IContextChannel> IExtensibleObject<IContextChannel>.Extensions
 642        {
 0643            get { return ((IContextChannel)_serviceChannel).Extensions; }
 644        }
 645
 646        Task IOutputChannel.SendAsync(Message message)
 647        {
 0648            return _serviceChannel.SendAsync(message);
 649        }
 650
 651        Task IOutputChannel.SendAsync(Message message, CancellationToken token)
 652        {
 0653            return _serviceChannel.SendAsync(message, token);
 654        }
 655
 656        Task<Message> IRequestChannel.RequestAsync(Message message)
 657        {
 0658            return _serviceChannel.RequestAsync(message);
 659        }
 660
 661        Task<Message> IRequestChannel.RequestAsync(Message message, CancellationToken token)
 662        {
 0663            return _serviceChannel.RequestAsync(message, token);
 664        }
 665
 666        Task IDuplexContextChannel.CloseOutputSessionAsync(CancellationToken token)
 667        {
 0668            return ((IDuplexContextChannel)_serviceChannel).CloseOutputSessionAsync(token);
 669        }
 670
 671        EndpointAddress IRequestChannel.RemoteAddress
 672        {
 0673            get { return _serviceChannel.RemoteAddress; }
 674        }
 675
 676        Uri IRequestChannel.Via
 677        {
 0678            get { return _serviceChannel.Via; }
 679        }
 680
 681        Uri IServiceChannel.ListenUri
 682        {
 0683            get { return _serviceChannel.ListenUri; }
 684        }
 685
 686        bool IDuplexContextChannel.AutomaticInputSessionShutdown
 687        {
 688            get
 689            {
 0690                return ((IDuplexContextChannel)_serviceChannel).AutomaticInputSessionShutdown;
 691            }
 692
 693            set
 694            {
 0695                ((IDuplexContextChannel)_serviceChannel).AutomaticInputSessionShutdown = value;
 0696            }
 697        }
 698
 699        InstanceContext IDuplexContextChannel.CallbackInstance
 700        {
 701            get
 702            {
 0703                return ((IDuplexContextChannel)_serviceChannel).CallbackInstance;
 704            }
 705
 706            set
 707            {
 0708                ((IDuplexContextChannel)_serviceChannel).CallbackInstance = value;
 0709            }
 710        }
 711
 0712        IServiceChannelDispatcher IChannel.ChannelDispatcher { get => ((IChannel)_serviceChannel).ChannelDispatcher; set
 713        #endregion // Channel interfaces
 714    }
 715}

Methods/Properties

CreateProxy(CoreWCF.Description.MessageDirection,CoreWCF.Channels.ServiceChannel)
ToString()
GetMethodData(CoreWCF.Channels.MethodCall)
GetServiceChannel()
Invoke(System.Reflection.MethodInfo,System.Object[])
CreateTask(CoreWCF.Channels.ServiceChannel,CoreWCF.Channels.MethodCall,CoreWCF.Dispatcher.ProxyOperationRuntime)
CreateGenericTask(CoreWCF.Channels.ServiceChannel,CoreWCF.Dispatcher.ProxyOperationRuntime,System.Object[])
CreateTask(CoreWCF.Channels.ServiceChannel,CoreWCF.Dispatcher.ProxyOperationRuntime,System.Object[])
.ctor(System.Type)
Task()
TrySetResult(System.Object)
TrySetException(System.Exception)
TrySetCanceled()
.cctor()
.ctor(System.Type)
ResultType()
GenericType()
TaskProperty()
TrySetResultMethod()
TrySetExceptionMethod()
TrySetCanceledMethod()
GetTaskCompletionSourceInfo(System.Type)
InvokeTaskService(CoreWCF.Channels.MethodCall,CoreWCF.Dispatcher.ProxyOperationRuntime)
InvokeChannel(CoreWCF.Channels.MethodCall)
InvokeGetType(CoreWCF.Channels.MethodCall)
InvokeBeginService(CoreWCF.Channels.MethodCall,CoreWCF.Dispatcher.ProxyOperationRuntime)
InvokeEndService(CoreWCF.Channels.MethodCall,CoreWCF.Dispatcher.ProxyOperationRuntime)
InvokeService(CoreWCF.Channels.MethodCall,CoreWCF.Dispatcher.ProxyOperationRuntime)
ExecuteMessage(System.Object,CoreWCF.Channels.MethodCall)
.ctor()
ThisLock()
TryGetMethodData(System.Reflection.MethodBase,CoreWCF.Channels.ServiceChannelProxy/MethodData&)
FindMethod(CoreWCF.Channels.ServiceChannelProxy/MethodData[],System.Reflection.MethodBase)
SetMethodData(CoreWCF.Channels.ServiceChannelProxy/MethodData)
.ctor(System.Reflection.MethodBase,CoreWCF.Channels.ServiceChannelProxy/MethodType)
.ctor(System.Reflection.MethodBase,CoreWCF.Channels.ServiceChannelProxy/MethodType,CoreWCF.Dispatcher.ProxyOperationRuntime)
MethodBase()
MethodType()
Operation()
CoreWCF.Channels.IChannel.GetProperty()
WCF.ICommunicationObject.get_State()
CoreWCF.ICommunicationObject.add_Closed(System.EventHandler)
CoreWCF.ICommunicationObject.remove_Closed(System.EventHandler)
CoreWCF.ICommunicationObject.add_Closing(System.EventHandler)
CoreWCF.ICommunicationObject.remove_Closing(System.EventHandler)
CoreWCF.ICommunicationObject.add_Faulted(System.EventHandler)
CoreWCF.ICommunicationObject.remove_Faulted(System.EventHandler)
CoreWCF.ICommunicationObject.add_Opened(System.EventHandler)
CoreWCF.ICommunicationObject.remove_Opened(System.EventHandler)
CoreWCF.ICommunicationObject.add_Opening(System.EventHandler)
CoreWCF.ICommunicationObject.remove_Opening(System.EventHandler)
CoreWCF.ICommunicationObject.Abort()
CoreWCF.ICommunicationObject.CloseAsync()
CoreWCF.ICommunicationObject.CloseAsync(System.Threading.CancellationToken)
CoreWCF.ICommunicationObject.OpenAsync()
CoreWCF.ICommunicationObject.OpenAsync(System.Threading.CancellationToken)
CoreWCF.IClientChannel.add_UnknownMessageReceived(System.EventHandler`1<CoreWCF.UnknownMessageReceivedEventArgs>)
CoreWCF.IClientChannel.remove_UnknownMessageReceived(System.EventHandler`1<CoreWCF.UnknownMessageReceivedEventArgs>)
System.IDisposable.Dispose()
WCF.IContextChannel.get_InputSession()
WCF.IContextChannel.get_LocalAddress()
WCF.IContextChannel.get_OperationTimeout()
WCF.IContextChannel.set_OperationTimeout(System.TimeSpan)
WCF.IContextChannel.get_OutputSession()
WCF.Channels.IOutputChannel.get_RemoteAddress()
WCF.Channels.IOutputChannel.get_Via()
WCF.IContextChannel.get_RemoteAddress()
WCF.IContextChannel.get_SessionId()
WCF.IExtensibleObject<CoreWCF.IContextChannel>.get_Extensions()
CoreWCF.Channels.IOutputChannel.SendAsync(CoreWCF.Channels.Message)
CoreWCF.Channels.IOutputChannel.SendAsync(CoreWCF.Channels.Message,System.Threading.CancellationToken)
CoreWCF.Channels.IRequestChannel.RequestAsync(CoreWCF.Channels.Message)
CoreWCF.Channels.IRequestChannel.RequestAsync(CoreWCF.Channels.Message,System.Threading.CancellationToken)
CoreWCF.IDuplexContextChannel.CloseOutputSessionAsync(System.Threading.CancellationToken)
WCF.Channels.IRequestChannel.get_RemoteAddress()
WCF.Channels.IRequestChannel.get_Via()
WCF.IServiceChannel.get_ListenUri()
WCF.IDuplexContextChannel.get_AutomaticInputSessionShutdown()
WCF.IDuplexContextChannel.set_AutomaticInputSessionShutdown(System.Boolean)
WCF.IDuplexContextChannel.get_CallbackInstance()
WCF.IDuplexContextChannel.set_CallbackInstance(CoreWCF.InstanceContext)
WCF.Channels.IChannel.get_ChannelDispatcher()