JFLib

plat/control_ipc_win.rs (Windows)#

Source: lib/plat/control_ipc_win.rs

Nonblocking byte-mode named pipes with an explicit current-user DACL and remote denial.
Security APIs are loaded dynamically from advapi32; no additional static DLL dependency.
  • struct Listener User-private listener. Dropping closes the accepting handle; peer handles are separate.

  • struct Stream One accepted nonblocking local connection.

impl Listener

  • fn bind(app: &str) -> Result<Self, i32> Create a uniquely named endpoint with access granted only to the process token's user SID.
  • fn endpoint(&self) -> &str Address to advertise only while control is active.
  • fn accept(&mut self) -> Result<Option<Stream>, i32> Poll once for a client; the next accepting pipe retains exactly the same DACL.

impl Stream

  • fn read(&mut self, bytes: &mut [u8]) -> Result<Option<usize>, i32> Read available bytes. None means would block; Some(0) means peer EOF.
  • fn write(&mut self, bytes: &[u8]) -> Result<Option<usize>, i32> Write available bytes. None means the pipe buffer currently has no space.

Source: docs/API.md in the JFLib repository.