%% Connect to TCP/IP Remote Host Using Host Name
% Create the TCP/IP object t using the host address shown and port 80.

t = tcpclient("www.mathworks.com",80)

% When you connect using a host name, such as a specified web address or 'localhost', the IP address defaults to IPv6 format. If the server you are connecting to is expecting IPv4 format, connection fails. For IPv4, you can create a connection by specifying an explicit IP address rather than a host name.
% Copyright 2020 The MathWorks, Inc.