No BSD License
-
tcp_close(tcp_client_h)
% TCP_CLOSE closes the open socket, which the supplied handle
-
tcp_connect(ip_address, port_...
% TCP_CONNECT instances an ActiveX object from atlSocket DLL,
-
tcp_geterror(tcp_client_h)
% TCP_GETERROR returns a string, containg the last error
-
tcp_getserveripaddress(tcp_cl...
% TCP_GETSERVERIPADDRESS returns a string containing the server's
-
tcp_getserverportnum(tcp_clie...
% TCP_GETSERVERIPADDRESS returns the TCP port number, on the server,
-
tcp_getsocketerrorcode(tcp_cl...
% TCP_GETSOCKETERRORCODE returns the last error code, that the underlying
-
tcp_recv(tcp_client_h, vec_le...
% TCP_RECV reads a vector from an open socket.
-
tcp_send(tcp_client_h, buff, ...
% TCP_SEND sends a vector to the server, through an open socket.
-
View all files
from
atlSocket
by David Ganor
A TCP/IP client-side socket entity implemented as an ActiveX DLL.
|
| tcp_close(tcp_client_h)
|
function tcp_close(tcp_client_h)
%
% TCP_CLOSE closes the open socket, which the supplied handle
% is associated with and releases the ActiveX object.
% The function returns nothing.
%
% tcp_close(tcp_client_h)
%
% Author: David Ganor, WAVION Ltd.
% Last Update: 09/2003
% Revisions:
% 1. Created.
%% Checking input arguments
if (nargin ~= 1)
error('Wrong number of input arguments');
end
if ~isobject(tcp_client_h)
error('Input argument must be a handle to an ActiveX object');
end
if isempty(tcp_client_h)
error('Input argument cannot be empty');
end
%% Closing socket
res = invoke(tcp_client_h, 'close');
if (res ~= -1)
error_str = tcp_geterror(tcp_client_h);
if ~isempty(error_str)
error(['ActiveX object: ' error_str]);
else
error('TCP''s close() failed without any error reported inside ActiveX object');
end
end
%% Releasing memory
release(tcp_client_h);
clear tcp_client_h;
|
|
Contact us at files@mathworks.com