Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
yedajiang44 committed Aug 7, 2024
1 parent d7b320c commit 7158b72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/JT808.Protocol/Internal/DefaultMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public bool TryMerge(JT808Header header, byte[] data, IJT808Config config, out J
body = null;
var timeoutKey = GenerateKey(header.TerminalPhoneNo, header.MsgId);
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))
{
packages.Add((header.PackageIndex, data));
Expand Down

0 comments on commit 7158b72

Please sign in to comment.