Scripting Guide > Extending JMP > Use Sockets in JSL > Socket-Related Commands
Publication date: 07/08/2024

Socket-Related Commands

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", "chess.exnet.sas.com", "0"}}

Sometimes there can be more than one answer. In that case, the sublist might be repeated one or more times. These functions can be quite slow; you probably should not try to build a data table of every website name with it. For IPV6 compatibility, you should generally use names like “www.sas.com” rather than the numerical form of an address.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).