'\" t .\" Title: nanocat .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.12 .\" Date: 2021-01-25 .\" Manual: nanomsg 1.1.5 .\" Source: \ \& .\" Language: English .\" .TH "NANOCAT" "1" "2021-01-25" "\ \&" "nanomsg 1.1.5" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" nanocat \- a command\-line interface to nanomsg .SH "SYNOPSIS" .sp .if n .RS 4 .nf .fam C 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] .fam .fi .if n .RE .sp In the case symlinks are installed: .sp .if n .RS 4 .nf .fam C 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] .fam .fi .if n .RE .SH "DESCRIPTION" .sp 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. .SH "OPTIONS" .sp Generic: .sp \fB\-\-verbose,\-v\fP .RS 4 Increase verbosity of the nanocat .RE .sp \fB\-\-silent,\-q\fP .RS 4 Decrease verbosity of the nanocat .RE .sp \fB\-\-help,\-h\fP .RS 4 This help text .RE .sp Socket Types: .sp \fB\-\-push\fP .RS 4 Use NN_PUSH socket type .RE .sp \fB\-\-pull\fP .RS 4 Use NN_PULL socket type .RE .sp \fB\-\-pub\fP .RS 4 Use NN_PUB socket type .RE .sp \fB\-\-sub\fP .RS 4 Use NN_SUB socket type .RE .sp \fB\-\-req\fP .RS 4 Use NN_REQ socket type .RE .sp \fB\-\-rep\fP .RS 4 Use NN_REP socket type .RE .sp \fB\-\-surveyor\fP .RS 4 Use NN_SURVEYOR socket type .RE .sp \fB\-\-respondent\fP .RS 4 Use NN_RESPONDENT socket type .RE .sp \fB\-\-bus\fP .RS 4 Use NN_BUS socket type .RE .sp \fB\-\-pair\fP .RS 4 Use NN_PAIR socket type .RE .sp Socket Options: .sp \fB\-\-bind\fP \fIADDR\fP .RS 4 Bind socket to the address ADDR .RE .sp \fB\-\-connect\fP \fIADDR\fP .RS 4 Connect socket to the address ADDR .RE .sp \fB\-\-bind\-ipc,\-X\fP \fIPATH\fP .RS 4 Bind socket to the ipc address "ipc://PATH". .RE .sp \fB\-\-connect\-ipc,\-x\fP \fIPATH\fP .RS 4 Connect socket to the ipc address "ipc://PATH". .RE .sp \fB\-\-bind\-local,\-L\fP \fIPORT\fP .RS 4 Bind socket to the tcp address "tcp://127.0.0.1:PORT". .RE .sp \fB\-\-connect\-local,\-l\fP \fIPORT\fP .RS 4 Connect socket to the tcp address "tcp://127.0.0.1:PORT". .RE .sp \fB\-\-recv\-timeout\fP \fISEC\fP .RS 4 Set timeout for receiving a message .RE .sp \fB\-\-send\-timeout\fP \fISEC\fP .RS 4 Set timeout for sending a message .RE .sp SUB Socket Options: .sp \fB\-\-subscribe\fP \fIPREFIX\fP .RS 4 Subscribe to the prefix PREFIX. Note: socket will be subscribed to everything (empty prefix) if no prefixes are specified on the command\-line. .RE .sp Input Options: .sp \fB\-\-format\fP \fIFORMAT\fP .RS 4 Use echo format FORMAT (same as the options below) .RE .sp \fB\-\-raw\fP .RS 4 Dump message as is (Note: no delimiters are printed) .RE .sp \fB\-\-ascii,\-A\fP .RS 4 Print ASCII part of message delimited by newline. All non\-ascii characters replaced by dot. .RE .sp \fB\-\-quoted,\-Q\fP .RS 4 Print each message on separate line in double quotes with C\-like character escaping .RE .sp \fB\-\-msgpack\fP .RS 4 Print each message as msgpacked string (raw type). This is useful for programmatic parsing. .RE .sp Output Options: .sp \fB\-\-interval,\-i\fP \fISEC\fP .RS 4 Send message (or request) every SEC seconds .RE .sp \fB\-\-delay,\-d\fP \fISEC\fP .RS 4 Wait for SEC seconds before sending message (useful for one\-shot PUB sockets) .RE .sp \fB\-\-data,\-D\fP \fIDATA\fP .RS 4 Send DATA to the socket and quit for PUB, PUSH, PAIR, BUS socket. Use DATA to reply for REP or RESPONDENT socket. Send DATA as request for REQ or SURVEYOR socket. .RE .sp \fB\-\-file,\-F\fP \fIPATH\fP .RS 4 Same as \-\-data but get data from file PATH .RE .SH "EXAMPLES" .sp The ping\-pong with nn_req/nn_rep sockets (must be run simultaneously): .sp .if n .RS 4 .nf .fam C 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 .fam .fi .if n .RE .sp Or in shorter to write form: .sp .if n .RS 4 .nf .fam C nn_rep \-L1234 \-Dpong \-A nn_req \-l1234 \-Dping \-A .fam .fi .if n .RE .sp Do periodic requests once a second: .sp .if n .RS 4 .nf .fam C nn_req \-l1234 \-Dping \-A \-i 1 .fam .fi .if n .RE .sp The rep socket that never reply (no \-D option), may be used to check if resending the requests is actually work: .sp .if n .RS 4 .nf .fam C nanocat \-\-rep \-\-connect ipc:///var/run/app/req.socket .fam .fi .if n .RE .sp Send an output of the ls to whatever would connect to 127.0.0.1:1234 then exit: .sp .if n .RS 4 .nf .fam C ls | nanocat \-\-push \-L1234 \-F\- .fam .fi .if n .RE .sp Send heartbeats to imaginary monitoring service: .sp .if n .RS 4 .nf .fam C nanocat \-\-pub \-\-connect tpc://monitoring.example.org \-D"I am alive!" \-\-interval 10 .fam .fi .if n .RE .SH "SEE ALSO" .sp nanomsg(7) .SH "AUTHORS" .sp .MTO "paul\(atcolomiets.name" "Paul Colomiets" ""