<div dir="ltr"><div>Hi Dave,</div><div><br></div><div>Thanks, those examples give me a better understanding of what's going on here. What do you think we should do? It seems that SocketAddress >> #asByteArray also assumes IPv4, so I could update that to use the new NetNameResolver methods too. But is there anything else? Should #stringFromIPv6Address: and #addressFromIPv6String be updated to respond with appropriately configured SocketAddress instances, rather than plain ByteArrays?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 25, 2021 at 6:36 PM David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Jul 20, 2021 at 06:16:51PM +0000, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
> A new version of Network was added to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/Network-EG.246.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Network-EG.246.mcz</a><br>
> <br>
> ==================== Summary ====================<br>
> <br>
> Name: Network-EG.246<br>
> Author: EG<br>
> Time: 20 July 2021, 2:16:51.031725 pm<br>
> UUID: 286844ab-38ff-4f7d-97a4-37d69eda41e5<br>
> Ancestors: Network-ct.245<br>
> <br>
> Adding methods and helpers for:<br>
> 1. Converting from an IPv6 string to an IPv6 ByteArray;<br>
> 2. Converting from an IPv6 ByteArray to a valid IPv6 string.<br>
>   <br>
> Note that the complexity here is mostly taken up in dealing with the IPv6<br>
> "feature" of compressing the longest consecutive series of 0 values to<br>
> the string '::'.<br>
>   <br>
> I have also updated the plain #addressFromString: and #stringFromAddress:<br>
> methods to first try and see if they are dealing with what appears to<br>
> be and IPv6 string/bytes and to call the IPv6 specialized versions of<br>
> the method if so.<br>
> <br>
<br>
Interesting work, thanks. Here are some workspace doIts that illustrate<br>
how the raw address bytes related to the socket address information<br>
that is managed in the SocketPlugin in the VM. I used '<a href="http://google.com" rel="noreferrer" target="_blank">google.com</a>' as<br>
an example, because the resolver on my computer gives both an IPv4 and<br>
IPv6 address listing. I am on a 64-bit machine, and the socketAddressBytes<br>
below would be different on a 32-bit machine.<br>
<br>
google := NetNameResolver addressesForName: '<a href="http://google.com" rel="noreferrer" target="_blank">google.com</a>'.<br>
googleIPV6 := google second. "==> 2607:f8b0:4009:809::200e(<a href="http://ord37s33-in-x0e.1e100.net" rel="noreferrer" target="_blank">ord37s33-in-x0e.1e100.net</a>),0(0)-inet6-stream-tcp "<br>
socketAddress := googleIPV6 socketAddress. "==> 2607:f8b0:4009:809::200e(<a href="http://ord37s33-in-x0e.1e100.net" rel="noreferrer" target="_blank">ord37s33-in-x0e.1e100.net</a>),0(0) "<br>
socketAddress size. "==> 36 "<br>
socketAddressBytes := ByteArray streamContents: [:strm | strm nextPutAll: socketAddress]. "==> #[245 55 26 98 28 0 0 0 10 0 0 0 0 0 0 0 38 7 248 176 64 9 8 9 0 0 0 0 0 0 32 14 0 0 0 0] "<br>
rs := socketAddressBytes readStream.<br>
networkSessionID := rs next: 8. "==> #[245 55 26 98 28 0 0 0] "<br>
addressSize := rs next: 8. "==> #[10 0 0 0 0 0 0 0] "<br>
rawAddressBytes := rs next: 16. "==> #[38 7 248 176 64 9 8 9 0 0 0 0 0 0 32 14] "<br>
padding := rs next: 4. "==> #[0 0 0 0] "<br>
rs atEnd. "==> true" <br>
NetNameResolver stringFromIPv6Address: rawAddressBytes. "==> '2607:f8b0:4009:809::200e' "<br>
<br>
<br>
Dave<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Eric</div></div></div>