Unix datagram socket and FIONREAD #7017
Unanswered
andrewbaxter
asked this question in
Ideas
Replies: 1 comment 8 replies
-
Generally people just use a known maximum. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now UnixDatagram sockets are only really usable for packets with a reasonable known maximum size since the data size can't be known before read. It looks like the
FIONREAD
ioctl can be used to get the packet size, which withreadable()
would make this possible.I googled around and haven't found many examples of this usage, so I was wondering if there was some reason it's not more common (aside from needing an ioctl). For IPC it'd be be an order of magnitude easier than managing connections and doing the framing manually with a stream socket.
I was thinking compatibility, but Unix sockets are already unix-only, or else some sort of performance issue...
Beta Was this translation helpful? Give feedback.
All reactions