[ANN] Net/Proto 0.1.0

Version 0.1.0 of Net/Proto has been released into the wild.

This was actually released earlier, but in lieu of the discussion about
RWN, I thought I should make an announcement.

What is it?

An interface to the getprotobyname(), getprotobynumber() and
getprotoent() functions.

What’s it for?

You’ll most likely use them with sockets.

For those platforms that support them, the reentrant (i.e. thread-safe)
versions of these functions are used.


require “net/proto”

include Net

Proto.getprotobyname(“tcp”) -> 6

Proto.getprotobynumber(1) -> “icmp”

List them all

Proto.getprotoent{ |p|

puts p.name

puts p.aliases

puts p.proto



setprotoent() and endprotoent() functions have not been added (and I
doubt they ever will be since they’re relics IMHO).

Available on the RAA. Enjoy!