Refactored MATLAB client to use the Java client internally.
- Still need to implement selectDATA for all languages.
This commit is contained in:
@@ -1,28 +1,27 @@
|
||||
function [socket] = closeUDP(socket)
|
||||
% closeUDP Script that closes a UDP Socket
|
||||
function closeUDP(socket)
|
||||
% closeUDP Closes the specified connection and releases resources associated with it.
|
||||
%
|
||||
% Inputs
|
||||
% Socket: UDP Socket to be closed
|
||||
%
|
||||
% Outputs
|
||||
% Socket: Closed Socket
|
||||
% socket: An XPC client to close
|
||||
%
|
||||
% Use
|
||||
% 1. import XPlaneConnect.*;
|
||||
% 2. Socket = openUDP(49005);
|
||||
% 3. Status = closeUDP(Socket);
|
||||
% 2. socket = openUDP();
|
||||
% 3. closeUDP(socket);
|
||||
%
|
||||
% Contributors
|
||||
% [CT] Christopher Teubert (SGT, Inc.)
|
||||
% christopher.a.teubert@nasa.gov
|
||||
%
|
||||
% To Do
|
||||
% 1. Verify Input
|
||||
%
|
||||
% BEGIN CODE
|
||||
% [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;
|
||||
|
||||
assert(isequal(socket.isClosed(),1),'closeUDP: Error- Could not close socket');
|
||||
%% Track open clients
|
||||
global clients;
|
||||
%TODO: Remove stale clients
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user