No BSD License  

Highlights from
atlSocket

from atlSocket by David Ganor
A TCP/IP client-side socket entity implemented as an ActiveX DLL.

tcp_getsocketerrorcode(tcp_client_h)
function socket_error_code = tcp_getsocketerrorcode(tcp_client_h)
%
% TCP_GETSOCKETERRORCODE returns the last error code, that the underlying
% infrastructure (winsock2.dll) reports to the upper layers.
% This function is usefull while debugging and in case an error occours,
% when one needs to check the state of the socket.
%
%   socket_error_code = tcp_getsocketerrorcode(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

socket_error_code = get(tcp_client_h, 'LastWSocketErrorcode');

Contact us at files@mathworks.com