<commit_before>
import Glibc
import CSua
import Sua


func printHostIP(hostName: String) {
  var sa = SocketAddress(hostName: hostName)
  if let s = sa.ip6ToString() {
    print("Host: \(hostName), IP: \(s)")
  } else {
    print("Error: couldn't find address for \"\(hostName)\".")
    let msg = sa.errorMessage ?? ""
    print("Error message: \(msg)")
  }
}


var addressName = "google.com"
printHostIP(addressName)
printHostIP("reddit.com")

var sa = SocketAddress(hostName: addressName)
p(sa.ip4ToUInt32())
p(sa.ip4ToString())
p(sa.ip6ToString())
printList(sa.ip4ToStringList() ?? [])<commit_msg>Updated the Socket Hello example to match the latest API changes.<commit_after>
import Glibc
import CSua
import Sua


func printHostIP(hostName: String) {
  var sa = SocketAddress(hostName: hostName)
  if let s = sa.ip6ToString() {
    print("Host: \(hostName), IP: \(s)")
  } else {
    print("Error: couldn't find address for \"\(hostName)\".")
    let msg = sa.errorMessage ?? ""
    print("Error message: \(msg)")
  }
}


var addressName = "google.com"
printHostIP(addressName)
printHostIP("reddit.com")

var sa = SocketAddress(hostName: addressName)
p(sa.ip4ToUInt32())
p(sa.ip4ToString())
p(sa.ip6ToString())
if let a = sa.ip4ToStringList() {
  for ip in a {
    printList(ip)
  }
}
{'fraction_non_alphanumeric': 0.15683229813664595, 'fraction_numerical': 0.010869565217391304, 'mean_word_length': 4.304526748971194, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2544345', 'n_tokens_mistral': 468, 'n_tokens_neox': 459, 'n_words': 114}