This is based on specs created by @YorickPeterse for the rubysl/rubysl-socket move to a pure-ruby socket lib. Among the changes thusfar: * Many improvements to Addrinfo, including leveraging the JDK APIs better and having less state. More address types work correctly now. * Socket now handles more types of sockets, including servers. * Improvements to addressing behavior across all socket types. * In-progress refactoring of socket classes to be reusable from Socket grab-bag. At the moment there are around 565 specs tagged.
This is a big PR! Well done stitching your commits and my commits together!
I must raise the issue of whitespace again, though. You have a number of places here changing nothing but whitespace. In such a big PR I don't expect you to go back and fix that, but please be mindful of it in the future and try to set your IDE to not make spurious formatting changes.
EPIC...I did not spend much time on this but landing sooner and getting it pushed through the meat grinder (e.g. we need some bake + expanded testing).
One other tiny note: context.getRuntime() is fine but it is ok to do context.runtime if you want. We do this in so many places now I think it is an acceptable pattern to access the field.
JRuby after fix:
>> BasicSocket.allocate => #<BasicSocket:0x1f7030a6> >> BasicSocket.new NoMethodError: undefined method `initialize' for #<BasicSocket:0x396f6598> >> IPSocket.allocate => #<IPSocket:0x394e1a0f> >> IPsocket.new NoMethodError: undefined method `initialize' for #<IPSocket:0x1d29cf23>
 pry(main)> BasicSocket.allocate => #<BasicSocket:0x007fb4eb5292a0>  pry(main)> BasicSocket.new NoMethodError: undefined method `initialize' for #<BasicSocket:0x007fb4eb4f0950> from (pry):2:in `new'  pry(main)> IPSocket.allocate => #<IPSocket:0x007fb4eb4bb408>  pry(main)> IPSocket.new NoMethodError: undefined method `initialize' for #<IPSocket:0x007fb4e9c5f918>
Related to space trimming and