public bool TryReceive (TimeSpan timeout, out Message msg)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
ThrowIfDisposedOrNotOpen ();
msg = null;
msg = message_encoder.ReadMessage (new MemoryStream (bytes), int.MaxValue);
var id = msg.Headers.MessageId;
if (message_ids.Contains (id))
- return TryReceive (timeout - (DateTime.Now - start), out msg);
+ return TryReceive (timeout - (DateTime.UtcNow - start), out msg);
if (id != null) {
message_ids.Enqueue (id);
if (message_ids.Count >= binding_element.TransportSettings.DuplicateMessageHistoryLength)
if (!handle_announce_online)
return; // Offline announcement is done by another DiscoveryChannelDispatcher
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
Communication.Open (timeout);
// and call AnnouncementOnline().
// Published endpoints are added by DicoveryEndpointPublisherBehavior, which is added to each ServiceEndpoint in the primary (non-announcement) service.
if (dx != null) {
foreach (var edm in dx.PublishedEndpoints) {
- client.InnerChannel.OperationTimeout = timeout - (DateTime.Now - start);
+ client.InnerChannel.OperationTimeout = timeout - (DateTime.UtcNow - start);
client.AnnounceOnline (edm);
}
}
if (handle_announce_online)
return; // Offline announcement is done by another DiscoveryChannelDispatcher
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// and call AnnouncementOnline().
var dx = host.Extensions.Find<DiscoveryServiceExtension> ();
// Published endpoints are added by DicoveryEndpointPublisherBehavior, which is added to each ServiceEndpoint in the primary (non-announcement) service.
if (dx != null) {
foreach (var edm in dx.PublishedEndpoints) {
- client.InnerChannel.OperationTimeout = timeout - (DateTime.Now - start);
+ client.InnerChannel.OperationTimeout = timeout - (DateTime.UtcNow - start);
client.AnnounceOffline (edm);
}
}
// Then close the client.
- Communication.Close (timeout - (DateTime.Now - start));
+ Communication.Close (timeout - (DateTime.UtcNow - start));
}
protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
protected override void OnOpen (TimeSpan timeout)
{
// FIXME: use timeout
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
inner = CreateDiscoveryInnerChannel<TChannel> (factory);
- ((IChannel) inner).Open (timeout - (DateTime.Now - start));
+ ((IChannel) inner).Open (timeout - (DateTime.UtcNow - start));
}
public Message Request (Message msg)
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
+using System.Diagnostics;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
Assert.IsNull (cf.GetProperty<DiscoveryEndpoint> (), "#1");
var ch = cf.CreateChannel (DiscoveryClientBindingElement.DiscoveryEndpointAddress);
Assert.IsNull (ch.GetProperty<DiscoveryEndpoint> (), "#2");
- DateTime start = DateTime.Now;
+ var sw = Stopwatch.StartNew ();
ch.Open (TimeSpan.FromSeconds (5));
- Assert.IsTrue (DateTime.Now - start < TimeSpan.FromSeconds (15), "It is likely that FindCriteria.Duration is ignored");
+ Assert.IsTrue (sw.Elapsed < TimeSpan.FromSeconds (15), "It is likely that FindCriteria.Duration is ignored");
}
[Test]
var cf = be.BuildChannelFactory<IDuplexSessionChannel> (bc);
cf.Open ();
var ch = cf.CreateChannel (DiscoveryClientBindingElement.DiscoveryEndpointAddress);
- DateTime start = DateTime.Now;
+ var sw = Stopwatch.StartNew ();
ch.Open (TimeSpan.FromSeconds (5));
- Assert.IsTrue (DateTime.Now - start < TimeSpan.FromSeconds (15), "It is likely that FindCriteria.Duration is ignored");
+ Assert.IsTrue (sw.Elapsed < TimeSpan.FromSeconds (15), "It is likely that FindCriteria.Duration is ignored");
}
[Test]
{
// HTTP channel could be accepted while there is no incoming request yet. The reply channel waits for the actual request.
// HTTP channel listeners do not accept more than one channel at a time.
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
TimeSpan waitTimeout;
if (timeout == TimeSpan.MaxValue)
waitTimeout = TimeSpan.FromMilliseconds(int.MaxValue);
else
- waitTimeout = timeout - (DateTime.Now - start);
+ waitTimeout = timeout - (DateTime.UtcNow - start);
accept_channel_handle.WaitOne (waitTimeout);
accept_channel_handle.Reset ();
- TChannel ch = CreateChannel (timeout - (DateTime.Now - start));
+ TChannel ch = CreateChannel (timeout - (DateTime.UtcNow - start));
ch.Closed += delegate {
accept_channel_handle.Set ();
};
public bool TryDequeueRequest (ChannelDispatcher channel, TimeSpan timeout, out HttpContextInfo context)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
context = null;
HttpChannelListenerEntry ce = null;
if (timeout == TimeSpan.MaxValue)
waitTimeout = TimeSpan.FromMilliseconds (int.MaxValue);
bool ret = ce.WaitHandle.WaitOne (waitTimeout);
- return ret && TryDequeueRequest (channel, waitTimeout - (DateTime.Now - start), out context); // recurse, am lazy :/
+ return ret && TryDequeueRequest (channel, waitTimeout - (DateTime.UtcNow - start), out context); // recurse, am lazy :/
}
context = q.Dequeue ();
return true;
return;
close_started = true;
}
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// FIXME: consider timeout
- AbortConnections (timeout - (DateTime.Now - start));
+ AbortConnections (timeout - (DateTime.UtcNow - start));
- base.OnClose (timeout - (DateTime.Now - start));
+ base.OnClose (timeout - (DateTime.UtcNow - start));
}
protected string GetHeaderItem (string raw)
{
ThrowIfDisposedOrNotOpen ();
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// FIXME: give max buffer size
var mb = message.CreateBufferedCopy (0x10000);
pc.Status = RemotePeerStatus.Error; // prepare for cases that it resulted in an error in the middle.
var inner = CreateInnerClient (pc);
pc.Channel = inner;
- inner.Open (timeout - (DateTime.Now - start));
- inner.OperationTimeout = timeout - (DateTime.Now - start);
+ inner.Open (timeout - (DateTime.UtcNow - start));
+ inner.OperationTimeout = timeout - (DateTime.UtcNow - start);
inner.Connect (new ConnectInfo () { Address = local_node_address, NodeId = (uint) node.NodeId });
- pc.Instance.WaitForConnectResponse (timeout - (DateTime.Now - start));
+ pc.Instance.WaitForConnectResponse (timeout - (DateTime.UtcNow - start));
pc.Status = RemotePeerStatus.Connected;
}
- pc.Channel.OperationTimeout = timeout - (DateTime.Now - start);
+ pc.Channel.OperationTimeout = timeout - (DateTime.UtcNow - start);
// see [MC-PRCH] 3.2.4.1
if (message.Headers.MessageId == null)
public override bool TryReceive (TimeSpan timeout, out Message message)
{
ThrowIfDisposedOrNotOpen ();
- DateTime start = DateTime.Now;
if (queue.Count > 0 || receive_handle.WaitOne (timeout)) {
message = queue.Dequeue ();
protected override void OnClose (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
if (client_factory != null)
- client_factory.Close (timeout - (DateTime.Now - start));
+ client_factory.Close (timeout - (DateTime.UtcNow - start));
peers.Clear ();
- resolver.Unregister (node.RegisteredId, timeout - (DateTime.Now - start));
+ resolver.Unregister (node.RegisteredId, timeout - (DateTime.UtcNow - start));
node.SetOffline ();
if (listener_host != null)
- listener_host.Close (timeout - (DateTime.Now - start));
+ listener_host.Close (timeout - (DateTime.UtcNow - start));
node.RegisteredId = null;
}
protected override void OnOpen (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// FIXME: supply maxAddresses
foreach (var a in resolver.Resolve (node.MeshId, 3, timeout))
int port = 0;
var rnd = new Random ();
for (int i = 0; i < 1000; i++) {
- if (DateTime.Now - start > timeout)
+ if (DateTime.UtcNow - start > timeout)
throw new TimeoutException ();
try {
port = rnd.Next (50000, 51000);
// FIXME: remove debugging code
listener_host.UnknownMessageReceived += delegate (object obj, UnknownMessageReceivedEventArgs earg) { Console.WriteLine ("%%%%% UNKOWN MESSAGE " + earg.Message); };
- listener_host.Open (timeout - (DateTime.Now - start));
+ listener_host.Open (timeout - (DateTime.UtcNow - start));
var nid = (ulong) new Random ().Next (0, int.MaxValue);
var ea = new EndpointAddress (uri);
var pna = new PeerNodeAddress (ea, new ReadOnlyCollection<IPAddress> (Dns.GetHostEntry (name).AddressList));
local_node_address = pna;
- node.RegisteredId = resolver.Register (node.MeshId, pna, timeout - (DateTime.Now - start));
+ node.RegisteredId = resolver.Register (node.MeshId, pna, timeout - (DateTime.UtcNow - start));
node.NodeId = nid;
// Add itself to the local list as well.
protected override TChannel OnAcceptChannel (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// Close channels that are incorrectly kept open first.
var l = new List<TcpDuplexSessionChannel> ();
l.Add (dch);
}
foreach (var dch in l)
- dch.Close (timeout - (DateTime.Now - start));
+ dch.Close (timeout - (DateTime.UtcNow - start));
- TcpClient client = AcceptTcpClient (timeout - (DateTime.Now - start));
+ TcpClient client = AcceptTcpClient (timeout - (DateTime.UtcNow - start));
if (client == null)
return null; // onclose
// TcpReplyChannel requires refreshed connection after each request processing.
internal TcpClient AcceptTcpClient (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
TcpClient client = accepted_clients.Count == 0 ? null : accepted_clients.Dequeue ();
if (client == null) {
}
accept_handles.Remove (wait);
// recurse with new timeout, or return null if it's either being closed or timed out.
- timeout -= (DateTime.Now - start);
+ timeout -= (DateTime.UtcNow - start);
return State == CommunicationState.Opened && timeout > TimeSpan.Zero ? AcceptTcpClient (timeout) : null;
}
continue;
if (((IPEndPoint) dch.TcpClient.Client.RemoteEndPoint).Equals (client.Client.RemoteEndPoint))
// ... then it should be handled in another BeginTryReceive/EndTryReceive loop in ChannelDispatcher.
- return AcceptTcpClient (timeout - (DateTime.Now - start));
+ return AcceptTcpClient (timeout - (DateTime.UtcNow - start));
}
return client;
if (client.Available > 0)
return true;
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
do {
Thread.Sleep (50);
if (client.Available > 0)
return true;
- } while (DateTime.Now - start < timeout);
+ } while (DateTime.UtcNow - start < timeout);
return false;
}
if (timeout <= TimeSpan.Zero)
throw new ArgumentException (String.Format ("Timeout value must be positive value. It was {0}", timeout));
- DateTime start = DateTime.Now;
-
// FIXME: use timeout
if (client == null)
client = ((TcpChannelListener<IReplyChannel>) Manager).AcceptTcpClient (timeout);
{
Logger.LogMessage (MessageLogSourceKind.TransportSend, ref message, owner.info.BindingElement.MaxReceivedMessageSize);
- DateTime start = DateTime.Now;
owner.frame.WriteUnsizedMessage (message, timeout);
// FIXME: consider timeout here too.
owner.frame.WriteEndRecord ();
public override bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)
{
try {
- DateTime start = DateTime.Now;
context = ReceiveRequest (timeout);
return context != null;
} catch (Exception ex) {
public override Message Request (Message input, TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// FIXME: use timeouts.
frame.ProcessPreambleInitiator ();
Logger.LogMessage (MessageLogSourceKind.TransportSend, ref input, int.MaxValue); // It is not a receive buffer
- frame.WriteUnsizedMessage (input, timeout - (DateTime.Now - start));
+ frame.WriteUnsizedMessage (input, timeout - (DateTime.UtcNow - start));
// LAMESPEC: it contradicts the protocol described at section 3.1.1.1.1 in [MC-NMF].
// Moving this WriteEndRecord() after ReadUnsizedMessage() causes TCP connection blocking.
frame.WriteEndRecord ();
- var ret = frame.ReadUnsizedMessage (timeout - (DateTime.Now - start));
+ var ret = frame.ReadUnsizedMessage (timeout - (DateTime.UtcNow - start));
Logger.LogMessage (MessageLogSourceKind.TransportReceive, ref ret, info.BindingElement.MaxReceivedMessageSize);
public override bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
if (!inner.TryReceiveRequest (timeout, out context))
return false;
var support = Source.SecuritySupport;
var commAuth = support.TokenAuthenticator as CommunicationSecurityTokenAuthenticator;
if (commAuth != null)
- res = commAuth.Communication.ProcessNegotiation (req, timeout - (DateTime.Now - start));
+ res = commAuth.Communication.ProcessNegotiation (req, timeout - (DateTime.UtcNow - start));
else
throw new MessageSecurityException ("This reply channel does not expect incoming WS-Trust requests");
- context.Reply (res, timeout - (DateTime.Now - start));
- context.Close (timeout - (DateTime.Now - start));
+ context.Reply (res, timeout - (DateTime.UtcNow - start));
+ context.Close (timeout - (DateTime.UtcNow - start));
// wait for another incoming message
- return TryReceiveRequest (timeout - (DateTime.Now - start), out context);
+ return TryReceiveRequest (timeout - (DateTime.UtcNow - start), out context);
break;
}
protected override void OnClose (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
// this implicitly premises: TChannel is IChannel
foreach (IChannel ch in channels)
- ch.Close (timeout - (DateTime.Now - start));
- base.OnClose (timeout - (DateTime.Now - start));
+ ch.Close (timeout - (DateTime.UtcNow - start));
+ base.OnClose (timeout - (DateTime.UtcNow - start));
}
protected override IAsyncResult OnBeginClose (TimeSpan timeout, AsyncCallback callback, object state)
{
Console.WriteLine ("NamedPipeChannelListener.OnAcceptChannel");
- DateTime start = DateTime.Now;
if (active_server != null) {
try {
server_release_handle.WaitOne (timeout);
if (message.Headers.RelatesTo == null)
message.Headers.RelatesTo = request.Headers.MessageId;
- DateTime start = DateTime.Now;
owner.frame.WriteUnsizedMessage (message, timeout);
owner.frame.WriteEndRecord ();
owner.server.Close ();
public override bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)
{
try {
- DateTime start = DateTime.Now;
context = ReceiveRequest (timeout);
return context != null;
} catch (TimeoutException) {
protected override void OnOpen (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
-
// FIXME: use timeout
frame = new TcpBinaryFrameManager (TcpBinaryFrameManager.SingletonUnsizedMode, server, true) { Encoder = this.Encoder };
frame.ProcessPreambleRecipient ();
public override Message Request (Message input, TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
CreateClient (timeout);
if (input.Headers.MessageId == null)
input.Headers.MessageId = new UniqueId ();
- frame.WriteUnsizedMessage (input, timeout - (DateTime.Now - start));
+ frame.WriteUnsizedMessage (input, timeout - (DateTime.UtcNow - start));
frame.WriteEndRecord ();
- var ret = frame.ReadUnsizedMessage (timeout - (DateTime.Now - start));
+ var ret = frame.ReadUnsizedMessage (timeout - (DateTime.UtcNow - start));
frame.ReadEndRecord ();
return ret;
}
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 ();
if (loop_thread == null)
return;
- close_started = DateTime.Now;
+ close_started = DateTime.UtcNow;
close_timeout = timeout;
loop = false;
creator_handle.Set ();
}
else {
try {
- ch.Close (close_timeout - (DateTime.Now - close_started));
+ ch.Close (close_timeout - (DateTime.UtcNow - close_started));
} catch (Exception ex) {
// FIXME: log it.
Logger.Error (String.Format ("Exception on closing channel ({0})", ch.GetType ()), ex);
if (node == null)
return new RefreshResponseInfo () { Result = RefreshResult.RegistrationNotFound };
node.Refresh ();
- return new RefreshResponseInfo () { Result = RefreshResult.Success, RegistrationLifetime = RefreshInterval - (DateTime.Now - node.LastRefreshTime) };
+ return new RefreshResponseInfo () { Result = RefreshResult.Success, RegistrationLifetime = RefreshInterval - (DateTime.UtcNow - node.LastRefreshTime) };
}
public RegisterResponseInfo Register (RegisterInfo registerInfo)
lock (mesh) {
var node = new Node () { ClientId = clientId, Address = addr };
mesh.Add (node);
- node.LastRefreshTime = DateTime.Now;
+ node.LastRefreshTime = DateTime.UtcNow;
return node;
}
}
public void Refresh ()
{
- LastRefreshTime = DateTime.Now;
+ LastRefreshTime = DateTime.UtcNow;
}
public void Update (PeerNodeAddress addr)
{
Address = addr;
- LastRefreshTime = DateTime.Now;
+ LastRefreshTime = DateTime.UtcNow;
}
}
}
protected override void OnClose (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
if (channel.State == CommunicationState.Opened)
channel.Close (timeout);
}
// FIXME: implement ConcurrencyMode check:
// if it is .Single && this instance for a callback channel && the operation is invoked inside service operation, then error.
- DateTime startTime = DateTime.Now;
+ DateTime startTime = DateTime.UtcNow;
OutputChannel.Send (msg, timeout);
- return ((IDuplexChannel) channel).Receive (timeout - (DateTime.Now - startTime));
+ return ((IDuplexChannel) channel).Receive (timeout - (DateTime.UtcNow - startTime));
}
internal IAsyncResult BeginRequest (Message msg, TimeSpan timeout, AsyncCallback callback, object state)
protected override void OnClose (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
base.OnClose (timeout);
loop = false;
- if (!loop_handle.WaitOne (timeout - (DateTime.Now - start)))
+ if (!loop_handle.WaitOne (timeout - (DateTime.UtcNow - start)))
throw new TimeoutException ();
- if (!finish_handle.WaitOne (timeout - (DateTime.Now - start)))
+ if (!finish_handle.WaitOne (timeout - (DateTime.UtcNow - start)))
throw new TimeoutException ();
}
internal override Message RequestCorrelated (Message msg, TimeSpan timeout, IOutputChannel channel)
{
- DateTime startTime = DateTime.Now;
+ DateTime startTime = DateTime.UtcNow;
Message ret = null;
ManualResetEvent wait = new ManualResetEvent (false);
Action<Message> handler = delegate (Message reply) {
};
ReplyHandlerQueue.Enqueue (handler);
channel.Send (msg, timeout);
- if (ret == null && !wait.WaitOne (timeout - (DateTime.Now - startTime)))
+ if (ret == null && !wait.WaitOne (timeout - (DateTime.UtcNow - startTime)))
throw new TimeoutException ();
return ret;
}
void OnCloseOrAbort (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
ReleasePerformanceCounters ();
List<ChannelDispatcherBase> l = new List<ChannelDispatcherBase> (ChannelDispatchers);
foreach (ChannelDispatcherBase e in l) {
try {
- TimeSpan ts = timeout - (DateTime.Now - start);
+ TimeSpan ts = timeout - (DateTime.UtcNow - start);
if (ts < TimeSpan.Zero)
e.Abort ();
else
protected override sealed void OnOpen (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
InitializeRuntime ();
for (int i = 0; i < ChannelDispatchers.Count; i++) {
// Skip ServiceMetadataExtension-based one. special case.
var wait = new ManualResetEvent (false);
cd.Opened += delegate { wait.Set (); };
waits.Add (wait);
- cd.Open (timeout - (DateTime.Now - start));
+ cd.Open (timeout - (DateTime.UtcNow - start));
}
WaitHandle.WaitAll (waits.ToArray ());
sleepTime = 5 * 1000;\r
failTime = 2 * 1000;\r
}\r
- DateTime start = DateTime.Now;\r
+ var sw = global::System.Diagnostics.Stopwatch.StartNew ();\r
Client.Sleep (sleepTime);\r
- DateTime end = DateTime.Now;\r
- TimeSpan diff = end.Subtract (start);\r
+ sw.Stop ();\r
TimeSpan max = TimeSpan.FromMilliseconds(failTime);\r
- Assert.IsTrue (diff < max, "Sleep({0} milisec) must end in less than {1} seconds",sleepTime,failTime);\r
- if (sleepTime > (int) diff.TotalMilliseconds)\r
- Thread.Sleep (sleepTime - (int)diff.TotalMilliseconds); // wait for server thread to release itself\r
+ Assert.IsTrue (sw.Elapsed < max, "Sleep({0} milisec) must end in less than {1} seconds",sleepTime,failTime);\r
+ if (sleepTime > (int) sw.ElapsedMilliseconds)\r
+ Thread.Sleep (sleepTime - (int)sw.ElapsedMilliseconds); // wait for server thread to release itself\r
}\r
\r
[Test]\r
protected override TChannel OnAcceptChannel (TimeSpan timeout)
{
// HTTP channel listeners do not accept more than one channel at a time.
- DateTime start = DateTime.Now;
- accept_channel_handle.WaitOne (timeout - (DateTime.Now - start));
+ DateTime start = DateTime.UtcNow;
+ accept_channel_handle.WaitOne (timeout - (DateTime.UtcNow - start));
accept_channel_handle.Reset ();
- TChannel ch = CreateChannel (timeout - (DateTime.Now - start));
+ TChannel ch = CreateChannel (timeout - (DateTime.UtcNow - start));
ch.Closed += delegate {
accept_channel_handle.Set ();
};
protected override void OnClose (TimeSpan timeout)
{
- DateTime start = DateTime.Now;
+ DateTime start = DateTime.UtcNow;
if (reqctx != null)
reqctx.Close (timeout);
// FIXME: consider timeout
- AbortConnections (timeout - (DateTime.Now - start));
+ AbortConnections (timeout - (DateTime.UtcNow - start));
- base.OnClose (timeout - (DateTime.Now - start));
+ base.OnClose (timeout - (DateTime.UtcNow - start));
}
public override bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)