NetpipeFS let you mount a filesystem that allows processes to have a one-way communication over the network such that remote processes can communicate by writing and reading on their local files without managing a socket connection. Both processes just need to mount the filesystem and read or write from/to it to communicate. The file system will take care for them about network communication.
Running netpipefs is very simple:
netpipefs --port=[local_port] --host=[hostip] --hostport=[hostport] mountpoint
It is recommended to run NetpipeFS as regular user (not as root). For this to work the mountpoint must be owned by the user. If the port or hostport numbers are omitted NetpipeFS will use the default values.
Also many netpipefs options can be specified (see the Options section), including the connection timeout (--timeout=MILLISECONDS
).
To unmount the filesystem:
fusermount -u mountpoint
On BSD and macOS, to unmount the filesystem:
umount mountpoint
NetpipeFS can also be run with valgrind to check for memory leaks:
valgrind --sim-hints=fuse-compatible netpipefs --port=[local_port] --hostip=[hostip] --hostport=[hostport] mountpoint
To check if the filesystem is mounted:
mount | grep netpipefs
First, download NetpipeFS from this repo. On Linux and BSD, you will also need to install libfuse 2.9.0 or newer. On macOS, you need OSXFUSE instead. To build netpipefs, run the following command in the main directory:
$ make all
To run the test suite first build the tests by running make test
and finally run make run_test
to run the test suite.
Option | Description |
---|---|
-h, --help |
Print help and exit |
-d, --debug |
Print debugging information |
-p PORT, --port=PORT |
Port used for network communication |
--hostip=IP |
Host IP address. If "localhost" then AF_UNIX sockets are used |
--hostport=PORT |
Port used by host |
--timeout=MILLISECONDS |
Connection timeout. Expressed in milliseconds |
--writeahead=N |
How many bytes can be bufferized on write requests if the remote host can't receive data |
--readahead=N |
How many bytes can be received and put into the buffer to anticipate read requests |
-f |
Do not daemonize, stay in foreground |
-s |
Single threaded operation |
-delayconnect |
Connect to host after the filesystem is mounted |
NetpipeFS also accepts several options common to all FUSE file systems. See the FUSE official repository for further information.
To show what NetpipeFS can do and the usage of network pipes, there are several examples in the examples
directory.
Usually the examples work with two mountpoints but they don't mount the filesystem, so run NetpipeFS before running the examples.