-
Notifications
You must be signed in to change notification settings - Fork 2
/
umq.1
157 lines (157 loc) · 2.44 KB
/
umq.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.\" Generated with Ronnjs 0.3.8
.\" http://github.com/kapouer/ronnjs/
.
.TH "UMQ" "1" "December 2013" "" ""
.
.SH "NAME"
\fBumq\fR \-\- tcp message transport utility
.
.SH "SYNOPSIS"
\fBumq\fR <command> [\-hV]
.
.SH "OPTIONS"
\fB\-h, \-\-help\fR display this message
\fB\-V, \-\-version\fR output version
.
.SH "COMMANDS"
Push a message to a host with port
.
.P
\fB$ umq push <host> <port>\fR
.
.P
Receive a message on a host with port
.
.P
\fB$ umq recv <host> <port>\fR
.
.P
Display help on a command
.
.P
\fB$ umq help push\fR
.
.SH "EXAMPLES"
\fB$ echo "hello world" | umq push localhost 3000\fR
.
.P
\fB
$ umq recv localhost 3000 | { \\
while read line; do \\
echo "msg: $line"; \\
done; \\
}
\fR
.
.SH "USAGE"
.
.SS "SERVER"
Listening on localhost can be achieved by simple providing a port:
.
.P
\fB
$ umq recv 3000 | { \\
while read \-r line; do \\
echo "got: \'$line\'"; \\
done; \\
}
\fR
.
.P
This will create a server and listen on localhost port \fB3000\fR for all
incoming tcp messages\.
.
.SS "CONNECTING"
You can connect and read from the server by using \fBumq recv\fR with a host
and port:
.
.P
\fB$ umq recv localhost 3000\fR
.
.SS "PUSHING"
Pushing data to a umq receiver can be performed via \fBumq push\fR:
.
.P
\fB$ echo "ping" | umq push localhost 3000\fR
.
.P
This should yield the following response on the server:
.
.P
\fBgot: \'ping\'\fR
.
.SH "CAVEATS"
When multiple peers are connected via \fBumq recv <host> <port>\fR to a single
umq receiver, messages are emitted to each peer via the RR (Round\-Robin)
.
.SS "SERVER"
\fB
$ umq recv 3000 | while read \-r chunk; do echo "chunk: $chunk"; done
chunk:
chunk: 0
chunk: 1
chunk: 2
chunk: 3
chunk: 4
chunk: 5
chunk: 6
chunk: 7
chunk: 8
chunk: 9
chunk: 10
chunk: 11
\fR
.
.SS "PUSHER"
\fB
$ i=0 while true; do echo echo "$i"; ((++i)); sleep \.5; done | \\
umq push localhost 3000
\fR
.
.SS "PEER 1"
\fB\fR`
$ umq recv localhost 3000
.
.P
2
3
4
5
8
9
10
11
\fB\fR`
.
.SS "PEER 2"
\fB\fR`
$ umq recv localhost 3000
.
.P
6
7
\fB\fR`
.
.SH "AUTHOR"
.
.IP "\(bu" 4
Joseph Werle \fIjoseph\.werle@gmail\.com\fR
.
.IP "" 0
.
.SH "REPORTING BUGS"
.
.IP "\(bu" 4
https://github\.com/jwerle/umq/issues
.
.IP "" 0
.
.SH "SEE ALSO"
.
.IP "\(bu" 4
https://github\.com/jwerle/umq
.
.IP "" 0
.
.SH "LICENSE"
MIT (C) Copyright Joseph Werle 2013