| | | 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 | | |
| | | 4 | | using System.Threading; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Channels |
| | | 8 | | { |
| | | 9 | | internal class ReplyChannel : ServiceChannelBase, IReplyChannel |
| | | 10 | | { |
| | 28 | 11 | | public ReplyChannel(IDefaultCommunicationTimeouts timeouts, EndpointAddress localAddress) : base(timeouts) |
| | | 12 | | { |
| | 28 | 13 | | LocalAddress = localAddress; |
| | 28 | 14 | | } |
| | | 15 | | |
| | 0 | 16 | | public EndpointAddress LocalAddress { get; } |
| | | 17 | | |
| | | 18 | | public override T GetProperty<T>() |
| | | 19 | | { |
| | 28 | 20 | | if (typeof(T) == typeof(IReplyChannel)) |
| | | 21 | | { |
| | 0 | 22 | | return (T)(object)this; |
| | | 23 | | } |
| | | 24 | | |
| | 28 | 25 | | T baseProperty = base.GetProperty<T>(); |
| | 28 | 26 | | if (baseProperty != null) |
| | | 27 | | { |
| | 0 | 28 | | return baseProperty; |
| | | 29 | | } |
| | | 30 | | |
| | 28 | 31 | | return default; |
| | | 32 | | } |
| | | 33 | | |
| | 0 | 34 | | protected override void OnAbort() { } |
| | | 35 | | |
| | | 36 | | protected override Task OnCloseAsync(CancellationToken token) |
| | | 37 | | { |
| | 0 | 38 | | return Task.CompletedTask; |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | protected override Task OnOpenAsync(CancellationToken token) |
| | | 42 | | { |
| | 28 | 43 | | return Task.CompletedTask; |
| | | 44 | | } |
| | | 45 | | } |
| | | 46 | | } |