-
Notifications
You must be signed in to change notification settings - Fork 3
/
tcpserver-help.pd
234 lines (234 loc) · 8.21 KB
/
tcpserver-help.pd
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#N canvas 85 132 909 679 12;
#X floatatom 118 419 5 0 0 0 connections - - 0;
#X floatatom 142 449 5 0 0 0 socket - - 0;
#X floatatom 166 499 3 0 0 0 from - - 0;
#X floatatom 193 499 3 0 0 0 - - - 0;
#X floatatom 220 499 3 0 0 0 - - - 0;
#X floatatom 247 499 3 0 0 0 - - - 0;
#X msg 95 50 broadcast 1 2 3;
#X text 212 48 send to all clients;
#X text 202 385 argument is port number;
#X text 92 610 ***WARNING*** Attempting to print long messages can hang pd!;
#X obj 95 550 spigot;
#X obj 134 530 tgl 15 0 empty empty enable_print 17 7 0 10 #14e814 #fc2828 #2c004c 0 1;
#X obj 95 386 tcpserver 9997;
#X text 21 6 [tcpserver] waits for clients to connect to its port.;
#X text 94 593 Received messages are output as stream of bytes;
#X obj 95 573 print tcpserver:received;
#X msg 120 75 11 216 43;
#X obj 324 548 spigot;
#X obj 363 528 tgl 15 0 empty empty enable_print 17 7 0 10 #14e814 #fc2828 #2c004c 0 1;
#X obj 324 574 print tcpserver:status;
#N canvas 6 61 450 300 per.socket 0;
#X msg 93 154 disconnectsocket \$1;
#X floatatom 111 108 5 0 0 0 - - - 0;
#X obj 93 131 f;
#X obj 93 112 bng 15 250 50 0 empty empty empty 17 7 0 10 #fc2828 #e8e828 #000000;
#X msg 123 184 send 504 1 2 3;
#X text 233 183 send to client on socket 504;
#X text 242 153 disconnect by socket number;
#X obj 93 254 s \$0.tcpserver;
#X connect 0 0 7 0;
#X connect 1 0 2 1;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 7 0;
#X restore 157 225 pd per.socket;
#N canvas 6 61 492 322 per.client 0;
#X msg 20 81 disconnectclient \$1;
#X floatatom 38 32 5 0 0 0 - - - 0;
#X obj 20 57 f;
#X obj 20 38 bng 15 250 50 0 empty empty empty 17 7 0 10 #fc2828 #e8e828 #000000;
#X msg 75 136 client;
#X msg 50 111 client 1;
#X text 118 110 get state of client 1;
#X text 127 136 get state of all clients (list on right outlet);
#X text 162 81 disconnect by client number;
#X msg 100 161 client 1 1 2 3 4;
#X text 228 160 send (binary) 1 2 3 4 to client 1;
#X obj 20 224 s \$0.tcpserver;
#X connect 0 0 11 0;
#X connect 1 0 2 1;
#X connect 2 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 11 0;
#X connect 5 0 11 0;
#X connect 9 0 11 0;
#X restore 157 249 pd per.client;
#X msg 161 127 disconnect;
#X text 241 125 disconnect all clients;
#N canvas 313 127 698 341 default.targets 0;
#X msg 106 82 target 1;
#X msg 157 240 64 64 64 10;
#X text 173 83 per default \, send only to client #1;
#X text 244 241 send to the default target;
#X msg 63 43 target;
#X msg 116 112 target -2;
#X text 187 113 per default \, send to all clients but #2;
#X msg 133 156 targetsocket 7;
#X text 245 154 per default \, send only to client on socket 7;
#X msg 143 186 targetsocket -504;
#X text 272 186 per default \, send to all clients but the one on socket 504;
#X text 120 41 per default \, send to all connected clients (aka 'broadcast');
#X obj 106 268 s \$0.tcpserver;
#X connect 0 0 12 0;
#X connect 1 0 12 0;
#X connect 4 0 12 0;
#X connect 5 0 12 0;
#X connect 7 0 12 0;
#X connect 9 0 12 0;
#X restore 157 202 pd default.targets;
#X text 194 79 without specified method 'broadcast' is assumed (see default.targets);
#N canvas 352 180 881 841 getting.info 0;
#X floatatom 99 162 5 0 0 1 to_client - - 0;
#X floatatom 390 165 3 0 0 1 socket - - 0;
#X symbolatom 422 140 15 0 0 1 ip - - 0;
#X floatatom 359 189 5 0 0 1 client - - 0;
#X floatatom 454 115 7 0 0 1 port - - 0;
#X floatatom 180 117 5 0 0 1 on_socket - - 0;
#X floatatom 139 141 5 0 0 1 sentsize[bytes] - - 0;
#X obj 99 62 route sent;
#X obj 359 61 route client;
#X floatatom 99 342 5 0 0 1 socket - - 0;
#X floatatom 180 297 5 0 0 1 outsize[bytes] - - 0;
#X floatatom 139 321 5 0 0 1 insize[bytes] - - 0;
#X obj 99 242 route bufsize;
#X floatatom 93 501 3 0 0 0 - - - 0;
#X floatatom 147 501 3 0 0 0 - - - 0;
#X floatatom 120 501 3 0 0 0 - - - 0;
#X obj 93 421 route address;
#X obj 99 271 unpack f f f;
#X obj 359 87 unpack f f s f;
#X obj 99 91 unpack f f f;
#X obj 93 450 unpack f f f f f;
#X floatatom 174 501 3 0 0 1 ip - - 0;
#X floatatom 202 475 6 0 0 1 port - - 0;
#X text 361 261 info about current inqueue/outqueue;
#X obj 99 216 r \$0.tcpserver.o5;
#X obj 93 395 r \$0.tcpserver.o5;
#X obj 99 36 r \$0.tcpserver.o5;
#X obj 359 35 r \$0.tcpserver.o5;
#X text 354 435 NOTE: outlets #3 and #4 are for compatibility with mrpeach's net obects. You can get all information via outlet #5 as well;
#X obj 664 35 r \$0.tcpserver.o5;
#X obj 664 61 route type;
#X obj 664 86 symbol;
#X symbolatom 664 111 0 0 0 3 event-type - - 0;
#X msg 104 556 bang;
#X obj 104 581 s \$0.tcpserver;
#X obj 495 483 r \$0.tcpserver.o5;
#X obj 495 509 route local_address port;
#X obj 495 534 route IPv4;
#X floatatom 495 589 3 0 0 0 - - - 0;
#X floatatom 522 589 3 0 0 0 - - - 0;
#X floatatom 549 589 3 0 0 0 - - - 0;
#X floatatom 576 589 3 0 0 0 - - - 0;
#X text 458 588 from;
#X obj 495 566 unpack f f f f f;
#X floatatom 604 589 6 0 0 0 - - - 0;
#X floatatom 664 549 6 0 0 1 port - - 0;
#X text 227 565 query info about the server;
#X obj 89 701 route type;
#X obj 90 729 list prepend;
#X obj 90 754 list trim;
#X obj 90 779 route connect disconnect send receive client server;
#X obj 89 676 r \$0.tcpserver.o5;
#X text 217 716 the 'type' message comes first \, so you can use it to prefix the actual info-messages;
#X connect 7 0 19 0;
#X connect 8 0 18 0;
#X connect 12 0 17 0;
#X connect 16 0 20 0;
#X connect 17 0 9 0;
#X connect 17 1 11 0;
#X connect 17 2 10 0;
#X connect 18 0 3 0;
#X connect 18 1 1 0;
#X connect 18 2 2 0;
#X connect 18 3 4 0;
#X connect 19 0 0 0;
#X connect 19 1 6 0;
#X connect 19 2 5 0;
#X connect 20 0 13 0;
#X connect 20 1 15 0;
#X connect 20 2 14 0;
#X connect 20 3 21 0;
#X connect 20 4 22 0;
#X connect 24 0 12 0;
#X connect 25 0 16 0;
#X connect 26 0 7 0;
#X connect 27 0 8 0;
#X connect 29 0 30 0;
#X connect 30 0 31 0;
#X connect 31 0 32 0;
#X connect 33 0 34 0;
#X connect 35 0 36 0;
#X connect 36 0 37 0;
#X connect 36 1 45 0;
#X connect 37 0 43 0;
#X connect 43 0 38 0;
#X connect 43 1 39 0;
#X connect 43 2 40 0;
#X connect 43 3 41 0;
#X connect 43 4 44 0;
#X connect 47 0 48 1;
#X connect 47 1 48 0;
#X connect 48 0 49 0;
#X connect 49 0 50 0;
#X connect 51 0 47 0;
#X restore 589 465 pd getting.info;
#X text 602 546 copyright (c) 2009 Martin Peach;
#X text 602 563 copyright (c) 2010 Roman Haefeli;
#X obj 190 413 s \$0.tcpserver.o5;
#X obj 324 503 r \$0.tcpserver.o5;
#X text 704 362 check also:;
#X obj 707 384 tcpreceive;
#X obj 707 409 tcpclient;
#X obj 166 476 unpack f f f f f;
#X floatatom 275 499 6 0 0 0 - - - 0;
#X msg 141 159 port 10000;
#X text 223 158 reset port number;
#X msg 253 310 accept \$1;
#X obj 253 291 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X text 333 305 disable/enable accepting new connections;
#X msg 253 347 maxconnections 32;
#X text 385 349 set the maximum number of clients;
#X obj 15 345 r \$0.tcpserver;
#X text 319 224 where data is sent to;
#X text 602 580 copyright (c) 2010-2021 IOhannes m zmoelnig;
#N canvas 928 315 508 398 META 0;
#X text 12 5 KEYWORDS network;
#X text 12 25 LICENSE GPL-2.0-or-later;
#X text 12 95 DESCRIPTION listens on a port for bi-directional TCP/IP connections, f 67;
#X text 12 65 HELP_PATCH_AUTHORS Martin Peach \, Roman Haefeli \, IOhannes m zmölnig, f 66;
#X text 12 45 AUTHOR IOhannes m zmölnig;
#X text 12 255 OUTLET_1 number of open connections;
#X text 12 275 OUTLET_2 socket ID of the current connection;
#X text 12 295 OUTLET_3 IP address/port of the current remote client;
#X text 12 315 OUTLET_4 all the meta-information about the connections (and more) \, formatted as routeable messages, f 67;
#X text 12 235 OUTLET_0 list: serialized data received from clients;
#X text 12 135 INLET_0 broadcast ...: send the same data to all clients;
#X text 68 155 send <sock> ...: send data to the client connected via the socket ID <sock>, f 57;
#X text 68 187 client <cli> ...: send data to the client identified with the client-id <cli>;
#X restore 833 647 pd META;
#X connect 6 0 12 0;
#X connect 10 0 15 0;
#X connect 11 0 10 1;
#X connect 12 0 10 0;
#X connect 12 1 0 0;
#X connect 12 2 1 0;
#X connect 12 3 34 0;
#X connect 12 4 29 0;
#X connect 16 0 12 0;
#X connect 17 0 19 0;
#X connect 18 0 17 1;
#X connect 22 0 12 0;
#X connect 30 0 17 0;
#X connect 34 0 2 0;
#X connect 34 1 3 0;
#X connect 34 2 4 0;
#X connect 34 3 5 0;
#X connect 34 4 35 0;
#X connect 36 0 12 0;
#X connect 38 0 12 0;
#X connect 39 0 38 0;
#X connect 41 0 12 0;
#X connect 43 0 12 0;