Before creating and using a socket, you might need to retrieve information about the end that you want to connect to. GetAddrInfo( ) and GetNameInfo( ) each takes an address argument and an optional port argument and returns a list of information. For example:
Print( Get Addr Info( "www.sas.com" ) );
Print( Get Addr Info( "www.sas.com", "80" ) );
Print( Get Name Info( "149.173.5.120" ) );
{"Get Addr Info", "ok", {"PF_INET", "SOCK_0", "IPPROTO_0", "149.173.5.120", "0"}}
{"Get Addr Info", "ok", {"PF_INET", "SOCK_0", "IPPROTO_0", "149.173.5.120", "80"}}
{"Get Name Info", "ok", {"PF_INET", "SOCK_0", "IPPROTO_0", "www.sas.com", "0"}}