I'm trying to get WEBrick::GenericServer running unmodified.  This patch
brings the error forward to...the same function call it was failing at
before ('cause of an undefined constant).  Oh well.  It might be trivial
to get past that point, but I'm done for today.

This brings us *much* closer to a full socket implementation.  Here's the
status:

General differences:

All places where C Ruby had struct sockaddr use java.net.InetSocketAddress

All functions which are supposed to return a CNAME and aliases return an
empty array for aliases.

All functions which can use a symbolic port only work with numeric ports. 
Ditto for return values.

Functions which take optional flags ignore the flags.

A few constants on BasicSocket don't exist.

Methods which are unimplemented or implemented with caveats:

BasicSocket#for_fd
BasicSocket#close_read -- isn't used in any of the standard libraries;
does anything need this?
BasicSocket#close_write -- isn't used in any of the standard libraries;
does anything need this?
BasicSocket#shutdown -- works with how=2 (default); does anything use it
any other way?
BasicSocket#setsockopt
BasicSocket#getsockopt -- isn't used in any of the standard libraries; we
wouldn't implement it like C anyway

IPSocket#recvfrom

TCPServer#sysaccept
TCPServer#listen

UDPSocket -- no implementation at all...

Socket.socketpair
Socket.pair
Socket.getservbyname -- AFAIK, this doesn't have a java equivalent.
Socket.sockaddr_in
Socket.pack_sockaddr_in
Socket.unpack_sockaddr_in

The following methods are all low-level C-style calls, intended to allow
Ruby to get at platform-specific sockets.  If we implement them, we should
be able to assume the user knows they're in JRuby and not C Ruby, and can
expect different behaviour.  I don't know of any major ruby program or
library which uses them.

Socket.new
Socket.open
Socket#connect
Socket#bind
Socket#listen
Socket#accept
Socket#sysaccept
Socket#recvfrom

And then of course, there's the stickiest: Kernel#select

Anyway, have fun!

Evan

Attachment: socket.patch
Description: Binary data

Reply via email to