function status = mdsdisconnect(option)
% function to close communication with remote mds server
% eg : mdsdisconnect;
% mdsdisconnect('All') to close all open connections
% Basil P. DUVAL, Oct 1998

%status = mdsremote(4);
if(nargin <1)
  status = mdsipmex(4);
else
  if(ischar(option) & strcmp(lower(option),'all')) 
    status = mdsipmex(4,1);
  else
    error('Option provided: use "All" to close all connections');
  end
end
