Skip to content

Commit

Permalink
Resolve Concurrency Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Konloch committed Dec 9, 2023
1 parent a3b3fef commit 772bcaa
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public void run()
//remove any clients not connected
clients.removeIf(client ->
{
if(client == null)
return true;

boolean remove = !client.getSocket().isConnected();

if (remove && socketServer.getOnDisconnect() != null)
Expand All @@ -65,6 +68,9 @@ public void run()
//iterate thru all clients
for (SocketClient client : clients)
{
if(client == null)
continue;

try
{
//if the client has been disconnected, do not try to process anything
Expand Down

0 comments on commit 772bcaa

Please sign in to comment.