Stact icon indicating copy to clipboard operation
Stact copied to clipboard

Timeout is specified in TimeSpan, but doesn't tolerate all input in domain

Open haf opened this issue 14 years ago • 0 comments

public static bool SendRequestWaitForResponse<TRequest>(this UntypedChannel channel, TimeSpan timeout) 
in class ExtensionsForChannels

If I pass TimeSpan.MaxValue to this method, I get the exception:

System.ArgumentOutOfRangeException was unhandled by user code
  Message=Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: timeout
  Source=mscorlib
  ParamName=timeout
  StackTrace:
       at System.Threading.WaitHandle.WaitOne(TimeSpan timeout, Boolean exitContext)
       at Stact.ExtensionsForChannels.SendRequestWaitForResponse[TRequest](UntypedChannel channel, TimeSpan timeout) in d:\BuildAgent-02\work\115708377bf4f2b8\src\Stact\Channels\ExtensionsForChannels.cs:line 92
       at ReceiverSpike.contexts.finicky_consumer_context.with_filter(Action`1 action) in D:\code\throw-away\ReceiverSpike\ReceiverSpike\contexts\finicky_consumer_context.cs:line 59
       at ReceiverSpike.when_inserting_multiple_events_they_are_filtered_spec.<.ctor>b__0() in D:\code\throw-away\ReceiverSpike\ReceiverSpike\filter_specifications.cs:line 62
       at Machine.Specifications.Utility.RandomExtensionMethods.<InvokeAll>b__3(Action x)
       at Machine.Specifications.Utility.RandomExtensionMethods.Each[T](IEnumerable`1 enumerable, Action`1 action)
       at Machine.Specifications.Utility.RandomExtensionMethods.InvokeAll(IEnumerable`1 actions)
       at Machine.Specifications.Utility.RandomExtensionMethods.InvokeAll(IEnumerable`1 becauseActions)
       at Machine.Specifications.Model.Context.EstablishContext()
  InnerException: 

And yet I am passing a value that is completely valid according to the API...

How can I be sure to wait indefinitely for an actor without doing something like this?

haf avatar Dec 14 '11 18:12 haf