Browse Source

review

tags/v2.6.9
yedajiang44 9 months ago
parent
commit
7158b72a03
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/JT808.Protocol/Internal/DefaultMerger.cs

+ 3
- 1
src/JT808.Protocol/Internal/DefaultMerger.cs View File

@@ -44,7 +44,9 @@ namespace JT808.Protocol.Internal
body = null; body = null;
var timeoutKey = GenerateKey(header.TerminalPhoneNo, header.MsgId); var timeoutKey = GenerateKey(header.TerminalPhoneNo, header.MsgId);
if (!CheckTimeout(timeoutKey)) return false; if (!CheckTimeout(timeoutKey)) return false;
timeoutDictionary.TryAdd(timeoutKey, DateTime.Now.AddSeconds(config.AutoMergeTimeoutSecond));
var timeout = DateTime.Now.AddSeconds(config.AutoMergeTimeoutSecond);
if (timeoutDictionary.TryAdd(timeoutKey, timeout))
timeoutDictionary.TryUpdate(timeoutKey, timeout, timeout);
if (splitPackageDictionary.TryGetValue(header.TerminalPhoneNo, out var item) && item.TryGetValue(header.MsgId, out var packages)) if (splitPackageDictionary.TryGetValue(header.TerminalPhoneNo, out var item) && item.TryGetValue(header.MsgId, out var packages))
{ {
packages.Add((header.PackageIndex, data)); packages.Add((header.PackageIndex, data));


Loading…
Cancel
Save