nanocat --req {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nanocat --rep {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ] nanocat --push {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] nanocat --pull {--connect ADDR|--bind ADDR} [-AQ] nanocat --pub {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] nanocat --sub {--connect ADDR|--bind ADDR} [--subscribe PREFIX ...] [-AQ] nanocat --surveyor {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nanocat --respondent {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ] nanocat --bus {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nanocat --pair {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
In the case symlinks are installed:
nn_req {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nn_rep {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ] nn_push {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] nn_pull {--connect ADDR|--bind ADDR} [-AQ] nn_pub {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] nn_sub {--connect ADDR|--bind ADDR} [--subscribe PREFIX ...] [-AQ] nn_surveyor {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nn_respondent {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-AQ] nn_bus {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ] nn_pair {--connect ADDR|--bind ADDR} {--data DATA|--file PATH} [-i SEC] [-AQ]
The nanocat is a command-line tool to send and receive data via nanomsg sockets. It can be used for debugging purposes, sending files through the network, health checking the system or whatever else you can think of.
Generic:
--verbose,-v
--silent,-q
--help,-h
Socket Types:
--push
--pull
--pub
--sub
--req
--rep
--surveyor
--respondent
--bus
--pair
Socket Options:
--bind ADDR
--connect ADDR
--bind-ipc,-X PATH
--connect-ipc,-x PATH
--bind-local,-L PORT
--connect-local,-l PORT
--recv-timeout SEC
--send-timeout SEC
SUB Socket Options:
--subscribe PREFIX
Input Options:
--format FORMAT
--raw
--ascii,-A
--quoted,-Q
--msgpack
Output Options:
--interval,-i SEC
--delay,-d SEC
--data,-D DATA
--file,-F PATH
The ping-pong with nn_req/nn_rep sockets (must be run simultaneously):
nanocat --rep --bind tcp://127.0.0.1:1234 --data pong --format ascii nanocat --req --connect tcp://127.0.0.1:1234 --data ping --format ascii
Or in shorter to write form:
nn_rep -L1234 -Dpong -A nn_req -l1234 -Dping -A
Do periodic requests once a second:
nn_req -l1234 -Dping -A -i 1
The rep socket that never reply (no -D option), may be used to check if resending the requests is actually work:
nanocat --rep --connect ipc:///var/run/app/req.socket
Send an output of the ls to whatever would connect to 127.0.0.1:1234 then exit:
ls | nanocat --push -L1234 -F-
Send heartbeats to imaginary monitoring service:
nanocat --pub --connect tpc://monitoring.example.org -D"I am alive!" --interval 10
nanomsg(7)