missing features in socket

26 views
Skip to first unread message

Eric Wong

unread,
Oct 12, 2013, 10:07:25 PM10/12/13
to rubini...@googlegroups.com
I'll file proper bug reports in due time. Meanwhile I figure I'll post
them here in case I forget or I'm hit by a bus. I'll be a few days
before I can stomach a web browser+logins again. (I hate GUIs and
proprietary services/APIs/software)


Socket.new(:AF_UNIX, :SOCK_SEQPACKET, 0) fails with:
Missing or uninitialized constant: Socket::Constants::PF_AF_UNIX (NameError)

So then I tried: Socket.new(:UNIX, :SOCK_SEQPACKET, 0)
Which fails with:
unknown socket type SOCK_SEQPACKET (SocketError)

However, I finally got it working with: Socket.new(:UNIX, :SEQPACKET, 0)

All three variants work on MRI (on Linux). AF_UNIX, SOCK_SEQPACKET sockets
isn't very popular, yet, but recent FreeBSD supports it, too.

Once I was able to create local SOCK_SEQPACKET sockets, I also
discovered BasicSocket#sendmsg_nonblock and BasicSocket#recvmsg_nonblock
were both missing. These are preferable for working with non-stream
sockets since they respect message boundaries. MRI has had them for
a while, AFAIK.


Again, I'll try to gather a few more problems and file them all at
once.

This is all from dtas <http://dtas.80x24.org/README>.
(Not remotely a serious project :)

Eric Wong

unread,
Oct 19, 2013, 2:18:56 AM10/19/13
to rubini...@googlegroups.com
All IO objects opened by Ruby have close-on-exec bit set on the FD
in Ruby 2.0: https://bugs.ruby-lang.org/issues/5041

(I wish POSIX could make this change, too, but it's probably
too late for that :<)

Eric Wong <normal...@yhbt.net> wrote:
> I'll file proper bug reports in due time. Meanwhile I figure I'll post
> them here in case I forget or I'm hit by a bus. I'll be a few days
> before I can stomach a web browser+logins again. (I hate GUIs and
> proprietary services/APIs/software)

Haven't forgotten (already traumatized this morning for different
projects).
Reply all
Reply to author
Forward
0 new messages