本文整理匯總了C#中Shadowsocks.Model.Server.Identifier方法的典型用法代碼示例。如果您正苦於以下問題:C# Server.Identifier方法的具體用法?C# Server.Identifier怎麽用?C# Server.Identifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shadowsocks.Model.Server
的用法示例。
在下文中一共展示了Server.Identifier方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UpdateOutboundCounter
public void UpdateOutboundCounter(Server server, long n)
{
long count;
if (_outboundCounter.TryGetValue(server.Identifier(), out count))
{
count += n;
}
else
{
count = n;
_lastOutboundCounter[server.Identifier()] = 0;
}
_outboundCounter[server.Identifier()] = count;
}
示例2: UpdateLatency
public void UpdateLatency(Server server, int latency)
{
List<int> records;
_latencyRecords.TryGetValue(server.Identifier(), out records);
if (records == null)
{
records = new List<int>();
}
records.Add(latency);
_latencyRecords[server.Identifier()] = records;
}
示例3: UpdateLatency
public void UpdateLatency(Server server, int latency)
{
_latencyRecords.GetOrAdd(server.Identifier(), (k) =>
{
List<int> records = new List<int>();
records.Add(latency);
return records;
});
}
示例4: UpdateOutboundCounter
public void UpdateOutboundCounter(Server server, long n)
{
_inOutBoundRecords.AddOrUpdate(server.Identifier(), (k) =>
{
var r = new InOutBoundRecord();
r.UpdateOutbound(n);
return r;
}, (k, v) =>
{
v.UpdateOutbound(n);
return v;
});
}
示例5: UpdateOutboundCounter
public void UpdateOutboundCounter(Server server, long n)
{
_outboundCounter.AddOrUpdate(server.Identifier(), (k) =>
{
_lastOutboundCounter.GetOrAdd(server.Identifier(), 0);
return n;
}, (k, v) => (v + n));
}