nng icon indicating copy to clipboard operation
nng copied to clipboard

Add --pipe option to nngcat

Open thejoelw opened this issue 4 years ago • 3 comments

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.

thejoelw avatar Feb 04 '21 05:02 thejoelw

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.)

gdamore avatar Feb 07 '21 21:02 gdamore

this is a very nice feature - thanks!

dch avatar Feb 28 '21 14:02 dch

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

wishdev avatar Mar 17 '24 04:03 wishdev