Re: [racket-users] Opening unix domain socket with SOCK_SEQPACKET in Racket?

2020-01-28 Thread Ryan Culpepper

On 1/29/20 12:14 AM, Milo Turner wrote:

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.


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

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/29dc31f9-4443-ff74-241f-45dfa8c581c2%40ccs.neu.edu.


[racket-users] Opening unix domain socket with SOCK_SEQPACKET in Racket?

2020-01-28 Thread Milo Turner
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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0f4ba32a-58d3-4199-87cb-ebf51bc957a7%40googlegroups.com.