#talk with windows named pipes
1 messages · Page 1 of 1 (latest)
not really, but CreateNamedPipe is bound in std.os.windows.kernel32
is there a reason you don't want to use unix sockets?
i dont have an option im talking with an existing pipe, im not creating one
you connect to a named pipe by opening a file with the name of the pipe
so could i use a normal reader/writer on a std.fs.File?
yes
oh sick that makes my life a lot easier
means minimal code change on my end to support both
just don't try to use the seeking facilities, they'll likely complain
what about peeking? how do i peek for more data
use a peekStream
cus i need to know (non-blockingly) whether there is data for me
streams in general are not peekable because as soon as you see a byte it's been consumed
i dont want to know the data, only if there is data waiting for me
that's not available in the std apis
yeah on linux i call into ioctl to get that info on the unix socket, is there a way to do it on windows?
is ioctl a thing on windows?
not that im aware of
damn, i'll have to research more