2 // SecurityReplyChannel.cs
4 // Author: Atsushi Enomoto (atsushi@ximian.com)
6 // Copyright (C) 2006 Novell, Inc (http://www.novell.com)
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 using System.ServiceModel;
30 namespace System.ServiceModel.Channels
32 internal abstract class LayeredReplyChannel : LayeredCommunicationObject, IReplyChannel
36 public LayeredReplyChannel (IReplyChannel innerChannel)
42 public abstract ChannelListenerBase Listener { get; }
44 public override ChannelManagerBase ChannelManager {
45 get { return Listener; }
50 public virtual EndpointAddress LocalAddress {
51 get { return inner.LocalAddress; }
54 public virtual IAsyncResult BeginReceiveRequest (
55 AsyncCallback callback, object state)
57 return BeginReceiveRequest (Listener.DefaultReceiveTimeout, callback, state);
60 public virtual IAsyncResult BeginReceiveRequest (
61 TimeSpan timeout, AsyncCallback callback, object state)
63 return inner.BeginReceiveRequest (timeout, callback, state);
66 public virtual IAsyncResult BeginTryReceiveRequest (
67 TimeSpan timeout, AsyncCallback callback, object state)
69 return inner.BeginTryReceiveRequest (timeout, callback, state);
72 public virtual IAsyncResult BeginWaitForRequest (
73 TimeSpan timeout, AsyncCallback callback, object state)
75 return inner.BeginWaitForRequest (timeout, callback, state);
78 public virtual RequestContext EndReceiveRequest (IAsyncResult result)
80 return inner.EndReceiveRequest (result);
83 public virtual bool EndTryReceiveRequest (IAsyncResult result, out RequestContext context)
85 return inner.EndTryReceiveRequest (result, out context);
88 public virtual bool EndWaitForRequest (IAsyncResult result)
90 return inner.EndWaitForRequest (result);
93 public virtual RequestContext ReceiveRequest ()
95 return ReceiveRequest (Listener.DefaultReceiveTimeout);
98 public virtual RequestContext ReceiveRequest (TimeSpan timeout)
100 return inner.ReceiveRequest (timeout);
103 public virtual bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)
105 return inner.TryReceiveRequest (timeout, out context);
108 public virtual bool WaitForRequest (TimeSpan timeout)
110 return inner.WaitForRequest (timeout);
115 public virtual T GetProperty<T> () where T : class
117 return inner.GetProperty<T> ();