Collection<IErrorHandler> error_handlers
= new Collection<IErrorHandler> ();
IChannelListener listener;
- IDefaultCommunicationTimeouts timeouts;
+ internal IDefaultCommunicationTimeouts timeouts; // FIXME: remove internal
MessageVersion message_version;
bool receive_sync, include_exception_detail_in_faults,
manual_addressing, is_tx_receive;
SynchronizedCollection<EndpointDispatcher> endpoints;
[MonoTODO ("get binding info from config")]
- public ChannelDispatcher (IChannelListener listener)
+ public ChannelDispatcher (IChannelListener listener)
+ : this (listener, null)
{
- if (listener == null)
- throw new ArgumentNullException ("listener");
- Init (listener, null, null);
}
public ChannelDispatcher (
IChannelListener listener, string bindingName)
- : this (listener, bindingName,
- DefaultCommunicationTimeouts.Instance)
+ : this (listener, bindingName, null)
{
}
{
if (listener == null)
throw new ArgumentNullException ("listener");
- if (bindingName == null)
- throw new ArgumentNullException ("bindingName");
- if (timeouts == null)
- throw new ArgumentNullException ("timeouts");
Init (listener, bindingName, timeouts);
}
{
this.listener = listener;
this.binding_name = bindingName;
- this.timeouts = timeouts;
+ // IChannelListener is often a ChannelListenerBase
+ // which implements IDefaultCommunicationTimeouts.
+ this.timeouts = timeouts ?? listener as IDefaultCommunicationTimeouts ?? DefaultCommunicationTimeouts.Instance;
endpoints = new SynchronizedCollection<EndpointDispatcher> ();
}
//3. Let the appropriate endpoint handle the request.
IChannel ch = channel_acceptor ();
+ ch.Open (owner.timeouts.OpenTimeout);
reply = ch as IReplyChannel;
input = ch as IInputChannel;
throw new InvalidOperationException ("The reply channel didn't return RequestContext");
EndpointDispatcher candidate = FindEndpointDispatcher (rc.RequestMessage);
- new InputOrReplyRequestProcessor (candidate.DispatchRuntime, reply, owner.timeouts).
+ new InputOrReplyRequestProcessor (candidate.DispatchRuntime, reply).
ProcessReply (rc);
}
catch (EndpointNotFoundException ex) {
try {
candidate = FindEndpointDispatcher (message);
- new InputOrReplyRequestProcessor (candidate.DispatchRuntime, reply, owner.timeouts).
+ new InputOrReplyRequestProcessor (candidate.DispatchRuntime, input).
ProcessInput(message);
}
catch (EndpointNotFoundException ex) {