Files
XPlaneConnectCSP/MATLAB/+XPlaneConnect/closeUDP.m
Jason Watkins e191537bc9 Refactored MATLAB client to use the Java client internally.
- Still need to implement selectDATA for all languages.
2015-04-18 09:16:23 -07:00

27 lines
653 B
Matlab

function closeUDP(socket)
% closeUDP Closes the specified connection and releases resources associated with it.
%
% Inputs
% socket: An XPC client to close
%
% Use
% 1. import XPlaneConnect.*;
% 2. socket = openUDP();
% 3. closeUDP(socket);
%
% Contributors
% [CT] Christopher Teubert (SGT, Inc.)
% christopher.a.teubert@nasa.gov
% [JW] Jason Watkins
% jason.w.watkins@nasa.gov
%% Close the socket
assert(isequal(class(socket), 'gov.nasa.xpc.XPlaneConnect'),...
'[closeUDP] ERROR: socket was not an XPC client.');
socket.close;
%% Track open clients
global clients;
%TODO: Remove stale clients
end