Closed titzer closed 5 months ago
This code was written before layouts were merged
Indeed, I thought of going ahead and doing this, but alas, it uses big-endian integers, which are on the TODO list for layouts. I was not sure how client code uses serialized addresses, but another possible design is to have methods that write the serialized address out, and client code supplies an allocated for Range<byte>
, which could be a method like the acquire
method of a DataWriter
.
Indeed, I thought of going ahead and doing this, but alas, it uses big-endian integers, which are on the TODO list for layouts.
Ah yeah the network-byte order thing is annoying. Tbh I am not sure why it was designed in such a way, but here we are.
I was not sure how client code uses serialized addresses, but another possible design is to have methods that write the serialized address out, and client code supplies an allocated for
Range<byte>
, which could be a method like theacquire
method of aDataWriter
.
I'm not sure I follow? Are you asking how code that uses this library is supposed to create new addresses? You would just need to define an InetAddress
(so for example, def inetAddr = InetAddress.Ipv4(10,0,10,6);
) and then can use inetAddr
anywhere you want to create a socket.
Creating a PR to get input from @k-sareen on some minor refactorings to make the
net
code more Virgilic.