PeerTransportBindingElement source;
BindingContext context;
TChannel channel;
- MessageEncoder encoder;
AutoResetEvent accept_handle = new AutoResetEvent (false);
public PeerChannelListener (PeerTransportBindingElement source,
: base (context)
{
this.source = source;
- foreach (BindingElement be in context.RemainingBindingElements) {
+ foreach (BindingElement be in context.Binding.Elements) {
MessageEncodingBindingElement mbe = be as MessageEncodingBindingElement;
if (mbe != null) {
- encoder = CreateEncoder<TChannel> (mbe);
+ MessageEncoder = CreateEncoder<TChannel> (mbe);
break;
}
}
- if (encoder == null)
- encoder = new BinaryMessageEncoder ();
+ if (MessageEncoder == null)
+ MessageEncoder = new BinaryMessageEncoder ();
}
public PeerResolver Resolver { get; set; }
get { return source; }
}
- public MessageEncoder MessageEncoder {
- get { return encoder; }
- }
-
protected override TChannel OnAcceptChannel (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
if (channel != null)
if (!accept_handle.WaitOne (timeout))
throw new TimeoutException ();
- channel = PopulateChannel (timeout - (DateTime.Now - start));
+ channel = PopulateChannel (timeout - (DateTime.UtcNow - start));
((CommunicationObject) (object) channel).Closed += delegate {
this.channel = null;
accept_handle.Set ();