Opening unix domain socket with SOCK_SEQPACKET in Racket?

26 views
Skip to first unread message

Milo Turner

unread,
Jan 28, 2020, 6:14:39 PM1/28/20
to Racket Users
Hello all, 

I'm wondering if it's possible to open a unix domain socket with SOCK_SEQPACKET in Racket? It looks like currently unix-socket-lib uses SOCK_STREAM, and doesn't allow you to configure that flag. Is there a reason for this, or would it be a good idea to add this feature to the unix-socket-lib library? I would rather not issue the C FFI calls myself, because non-blocking IO is fairly difficult to do correctly from my previous impressions with it.

Thanks.
Milo

Ryan Culpepper

unread,
Jan 28, 2020, 7:36:51 PM1/28/20
to Milo Turner, Racket Users
SOCK_SEQPACKET sockets don't match Racket's port interface, which
doesn't have a notion of message boundaries, so you'd have to work
around that interface mismatch. Also, the unix-socket library reuses
Racket's implementation of ports backed by file descriptors. To support
SOCK_SEQPACKET, it would need a different implementation of read and
write that preserved message boundaries.

So it would be possible, but it's a fair amount of work, and no one
seems to have really needed SOCK_SEQPACKET support yet.

Ryan
Reply all
Reply to author
Forward
0 new messages