We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35cb05b commit 600b00bCopy full SHA for 600b00b
SteamTransport/Server.cs
@@ -2,6 +2,7 @@
2
using Steamworks;
3
using System;
4
using System.Collections.Generic;
5
+using System.Linq;
6
7
namespace SteamTransport;
8
@@ -102,7 +103,8 @@ public void Receive()
102
103
{
104
var ppOutMessages = new IntPtr[Util.MaxMessages];
105
- foreach (var conn in _conns)
106
+ // receive can result in disconnect, which modifies the collection. we must copy
107
+ foreach (var conn in _conns.ToList())
108
109
var numMessages = SteamNetworkingSockets.ReceiveMessagesOnConnection(conn, ppOutMessages, ppOutMessages.Length);
110
for (var i = 0; i < numMessages; i++)
0 commit comments