From 4835b5ac9fabf4d84fced5d7b5c69996232ee3a5 Mon Sep 17 00:00:00 2001 From: Jason Watkins Date: Thu, 14 May 2015 08:33:20 -0700 Subject: [PATCH] Fixed closeUDP in the MATLAB client to correctly remove closed clients from the global list. --- MATLAB/+XPlaneConnect/closeUDP.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MATLAB/+XPlaneConnect/closeUDP.m b/MATLAB/+XPlaneConnect/closeUDP.m index f49dd62..4941ae1 100644 --- a/MATLAB/+XPlaneConnect/closeUDP.m +++ b/MATLAB/+XPlaneConnect/closeUDP.m @@ -22,6 +22,10 @@ socket.close; %% Track open clients global clients; -%TODO: Remove stale clients +for i = 1:length(clients) + if socket == clients(i) + clients = [clients(1:i-1) clients(i+1:length(clients))]; + end +end end \ No newline at end of file