Skip to content

Commit 339d509

Browse files
committed
don't end sessions until acks can be sent
1 parent e29c3ed commit 339d509

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

MatterDotNet/Protocol/Sessions/SessionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ internal async Task DeleteExchange(Exchange exchange)
6262

6363
public void Dispose()
6464
{
65-
SessionManager.RemoveSession(LocalSessionID);
6665
Console.WriteLine("Closing Session " + LocalSessionID);
6766
var keys = exchanges.Keys;
6867
foreach (var key in keys)
6968
exchanges[key].Dispose();
69+
SessionManager.RemoveSession(LocalSessionID);
7070
GC.SuppressFinalize(this);
7171
}
7272
}

MatterDotNet/Protocol/Sessions/SessionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static SessionContext GetUnsecureSession(IConnection connection, bool ini
5555

5656
public static SessionContext? GetSession(ushort sessionId)
5757
{
58-
if (sessions.TryGetValue(sessionId, out SessionContext ctx))
58+
if (sessions.TryGetValue(sessionId, out SessionContext? ctx))
5959
return ctx;
6060
return null;
6161
}

0 commit comments

Comments
 (0)