nng
nng copied to clipboard
Add --pipe option to nngcat
It would be nice for nngcat to be able to send a stream of data from a unix pipe (stdin or a named pipe file). This is impossible to do with the existing --file option, which reads the data into memory, then sends it one or more times. With the proposed --pipe option, each line from the specified pipe is sent as a message. This is more similar to how the nc and socat utilities function.
This PR is unfortunately port portable (see the windows failures).
May consider converting it to use stdio (which is supported under all ANSI C platforms, including Windows.)
this is a very nice feature - thanks!
I took the original commit, switched it to fgets and ran clang-format on the file on my branch here [1] - I'm never sure the best way to move this type of thing forward. Should I just create a new pull request?
[1] - https://github.com/wishdev/nng/tree/fgets