You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
@ -221,7 +221,7 @@ namespace System.ServiceModel.Channels
|
||||
{
|
||||
ThrowIfDisposedOrNotOpen ();
|
||||
|
||||
DateTime start = DateTime.Now;
|
||||
DateTime start = DateTime.UtcNow;
|
||||
|
||||
// FIXME: give max buffer size
|
||||
var mb = message.CreateBufferedCopy (0x10000);
|
||||
@ -234,14 +234,14 @@ namespace System.ServiceModel.Channels
|
||||
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)
|
||||
@ -265,7 +265,6 @@ namespace System.ServiceModel.Channels
|
||||
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 ();
|
||||
@ -296,21 +295,21 @@ namespace System.ServiceModel.Channels
|
||||
|
||||
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))
|
||||
@ -323,7 +322,7 @@ namespace System.ServiceModel.Channels
|
||||
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);
|
||||
@ -351,13 +350,13 @@ namespace System.ServiceModel.Channels
|
||||
// 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.
|
||||
|
@ -73,7 +73,7 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
|
||||
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> ();
|
||||
@ -83,9 +83,9 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
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
|
||||
|
||||
@ -109,7 +109,7 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
// 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) {
|
||||
@ -121,7 +121,7 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
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;
|
||||
|
@ -187,12 +187,12 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,6 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
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);
|
||||
@ -110,7 +108,6 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
{
|
||||
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 ();
|
||||
@ -120,7 +117,6 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
public override bool TryReceiveRequest (TimeSpan timeout, out RequestContext context)
|
||||
{
|
||||
try {
|
||||
DateTime start = DateTime.Now;
|
||||
context = ReceiveRequest (timeout);
|
||||
return context != null;
|
||||
} catch (Exception ex) {
|
||||
|
@ -82,7 +82,7 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
|
||||
public override Message Request (Message input, TimeSpan timeout)
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
DateTime start = DateTime.UtcNow;
|
||||
|
||||
// FIXME: use timeouts.
|
||||
frame.ProcessPreambleInitiator ();
|
||||
@ -95,13 +95,13 @@ namespace System.ServiceModel.Channels.NetTcp
|
||||
|
||||
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);
|
||||
|
||||
|
Reference in New Issue
Block a user