#N canvas 184 37 1068 662 12;
#X text 15 625 see also:;
#X obj 58 12 netsend;
#X text 839 626 updated for Pd version 0.51.;
#X obj 6 71 cnv 1 1050 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 967 32 <= click;
#N canvas 105 96 1223 494 reference 0;
#X obj 8 42 cnv 5 525 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 8 178 cnv 2 525 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0;
#X obj 8 270 cnv 2 525 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 7 348 cnv 5 525 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 7 204 cnv 1 525 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000 0;
#X obj 7 235 cnv 1 525 1 empty empty 2nd: 8 12 0 13 #9f9f9f #000000 0;
#X obj 7 295 cnv 1 525 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0;
#X text 68 148 send <anything> -;
#X text 145 129 list -;
#X obj 28 11 netsend;
#X text 116 209 float - nonzero if connection is open \, zero otherwise.;
#X text 115 241 anything - messages sent back from netreceive objects.;
#X text 117 320 -b: sets to binary mode (default 'FUDI')., f 43;
#X text 76 57 connect <list> -;
#X text 104 91 disconnect - close the connection., f 55;
#X text 69 110 timeout <float> - TCP connect timeout in ms (default 10000).;
#X obj 565 42 cnv 5 650 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 565 157 cnv 2 650 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0;
#X obj 565 329 cnv 2 650 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 564 471 cnv 5 650 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 564 183 cnv 1 650 1 empty empty 1st: 8 12 0 13 #9f9f9f #000000 0;
#X obj 564 214 cnv 1 650 1 empty empty 2nd: 8 12 0 13 #9f9f9f #000000 0;
#X obj 564 352 cnv 1 650 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0;
#X obj 583 11 netreceive;
#X text 629 59 listen <float \, symbol> -;
#X text 804 58 a number sets or changes the port number (0 or negative closes the port). Optional symbol is a hostname which can be a UDP multicast address or a network interface., f 55;
#X text 677 125 send <anything> -;
#X text 727 186 anything - messages sent from connected netsend objects., f 57;
#X obj 564 419 cnv 1 650 1 empty empty args: 8 12 0 13 #9f9f9f #000000 0;
#X text 755 425 1) float - port number, f 45;
#X text 748 443 2) symbol - UDP hostname or multicast address.;
#X text 748 241 float - number of open connections for TCP connections., f 57;
#X text 755 301 list -;
#X text 609 218 (TCP connection only);
#X obj 564 269 cnv 1 650 1 empty empty rightmost: 8 12 0 13 #9f9f9f #000000 0;
#X text 653 273 (if the -f flag is given);
#X text 803 301 address and port., f 49;
#X text 754 106 list -;
#X text 744 376 -b: sets to binary mode (default 'FUDI')., f 52;
#X text 195 129 sends messages over the network., f 42;
#X text 195 148 works like 'list' (old way), f 42;
#X text 804 106 sends messages back to connected netsend objects., f 55;
#X text 804 125 works like 'list' (old way), f 55;
#X text 85 10 - send messages over a network connection.;
#X text 667 10 - listen for incoming messages from network;
#X text 117 302 -u: sets to UDP connection mode (default TCP).;
#X text 744 358 -u: sets to UDP connection mode (default TCP)., f 52;
#X text 744 394 -f: creates rightmost outlet for address & port., f 52;
#X text 195 56 sets host and port number \, an additional port can be set in UDP for listening back., f 42;
#X restore 873 32 pd reference;
#X obj 167 626 fudiformat;
#X obj 91 626 oscformat;
#X text 13 326 SECURITY NOTE: Don't publish the port number of your [netreceive] unless you wouldn't mind other people being able to send you messages., f 53;
#X obj 37 38 netreceive;
#X text 121 38 - listen for incoming messages from network;
#X obj 440 325 netsend;
#X msg 456 189 disconnect;
#X text 502 324 TCP \, FUDI;
#X obj 486 354 print backwards;
#X floatatom 724 335 4 0 0 0 - - - 0;
#X msg 662 219 listen 0;
#X text 731 219 (0 or negative number to close);
#X msg 649 183 listen 3000;
#X text 758 336 <-- number of open connections;
#X text 605 154 connection request (to 'localhost' and port 3000);
#X text 465 393 "1" if connection is open \, "0" otherwise.;
#X floatatom 440 392 2 0 0 0 - - - 0;
#X obj 440 355 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 424 80 A connection request should specify the name or IP address of the other host and the port number. There should be a [netreceive] object on the remote host with a matching port number. More than one [netsed] can connect to a single [netreceive] object. More than one [netreceive] object cannot listen to the same port at the same time., f 85;
#X msg 690 464 disconnect;
#X msg 670 432 connect localhost 3001;
#X obj 670 546 netsend -u;
#X floatatom 705 491 4 0 0 0 - - - 0;
#X text 752 548 UDP \, FUDI;
#X obj 888 528 netsend 1;
#X text 960 530 (UDP);
#X msg 705 515 send bar \$1;
#N canvas 125 161 813 504 binary-mode 0;
#X msg 79 143 disconnect;
#X msg 442 150 disconnect;
#X obj 417 277 netsend -u -b;
#X obj 63 273 netsend -b;
#X obj 130 312 print backwards;
#X obj 505 316 print backwards;
#X obj 63 312 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X floatatom 198 443 4 0 0 0 - - - 0;
#X obj 75 442 print TCP-binary;
#X listbox 100 220 17 0 255 0 - list - 0;
#X msg 75 378 1 2 3 4;
#X text 135 377 send back;
#X text 232 444 <- number of connections, f 13;
#X text 32 21 Example of TCP connection in binary mode. In this mode \, messages consist only of numbers from 0 to 255 and lists are broken into separate numbers., f 39;
#X obj 406 417 print UDP-binary;
#X obj 417 316 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 571 417 print Address/Port;
#X obj 660 135 loadbang;
#X msg 660 162 \; list set 0 1 0 1;
#X listbox 453 227 17 0 255 0 - list - 0;
#X msg 63 101 connect localhost 3003;
#X msg 417 108 connect localhost 3004;
#X obj 75 414 netreceive -b 3003;
#X obj 406 389 netreceive -u -b -f 3004;
#X text 354 26 Example of UDP connection in binary mode. Note you can use binary mode to send OSC messages \, for instance (see help file of [oscformat]/[oscparse] for examples on this).;
#X connect 0 0 3 0;
#X connect 1 0 2 0;
#X connect 2 0 15 0;
#X connect 2 1 5 0;
#X connect 3 0 6 0;
#X connect 3 1 4 0;
#X connect 9 0 3 0;
#X connect 10 0 22 0;
#X connect 17 0 18 0;
#X connect 19 0 2 0;
#X connect 20 0 3 0;
#X connect 21 0 2 0;
#X connect 22 0 8 0;
#X connect 22 1 7 0;
#X connect 23 0 14 0;
#X connect 23 1 16 0;
#X restore 134 429 pd binary-mode;
#X text 13 273 The Pd distribution includes "pdsend" and "pdreceive" standalone programs that work with [netsend] and [netreceive] in FUDI mode.;
#X obj 670 575 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 786 351 from [netsend] objects or other compatible clients), f 26;
#X msg 673 251 list TCP backwards;
#X listbox 476 298 15 0 0 0 - - - 0;
#X msg 476 246 list TCP Message;
#X text 814 245 lists send messages back to connected [netsend] objects, f 27;
#X obj 491 538 netreceive -u 3001;
#X text 677 283 '-f' flag creates rightmost outlet for address/port;
#X text 739 491 same as list;
#X text 13 191 By default the messages are ASCII text messages compatible with Pd (i.e. \, numbers and symbols terminated with a semicolon -- the "FUDI" protocol). See examples to the right. A flag sets to binary messages instead (see below)., f 53;
#X obj 10 612 cnv 1 1050 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 261 212 1047 513 IPv6/multicast 0;
#X obj 195 446 netsend -u;
#X msg 285 364 disconnect;
#X text 464 298 IPv4 multicast;
#X text 438 332 IPv6 multicast;
#X floatatom 298 400 5 0 0 0 - - - 0;
#X msg 275 330 connect ff00::114 3005;
#X msg 255 298 connect 239.200.200.200 3005;
#X msg 237 266 connect ::1 3005;
#X msg 218 234 connect 127.0.0.1 3005;
#X msg 195 201 connect localhost 3005;
#X text 361 203 IPv4 messages (default);
#X text 382 234 IPv4 messages;
#X text 358 267 IPv6 messages;
#X obj 58 378 netsend;
#X floatatom 97 307 5 0 0 0 - - - 0;
#X msg 58 201 connect ::1 3005;
#X text 26 17 As of 0.51 \, Pd supports IPv6 addresses \, [netsend] in UDP mode is fully "connectionless" and no longer closes if no one receives a UDP message \, and [netsend] in TCP mode has a settable connect timeout which defaults to 10 seconds., f 71;
#X text 854 277 IPv4 multicast;
#X text 839 309 IPv6 multicast;
#X msg 694 343 listen 0;
#X msg 666 308 listen 3005 ff00::114;
#X msg 646 277 listen 3005 239.200.200.200;
#X msg 616 212 listen 3005 ::1;
#X msg 607 177 listen 3005 127.0.0.1;
#X msg 627 245 listen 3005 localhost;
#X text 772 177 IPv4 messages;
#X obj 843 378 netreceive 3005 ::1, f 21;
#X text 842 341 listen for IPv6 TCP messages on localhost, f 22;
#X msg 593 144 listen 3005;
#X text 683 143 any IPv4 and IPv6 messages (default);
#X text 737 213 IPv6 messages *);
#X text 789 237 IPv4 and/or IPv6 messages (system dependent!), f 26;
#X text 603 455 *) On some systems you can also receive IPv4 messages. This certainly doesn't work on Windows!, f 50;
#X text 574 60 By default \, [netreceive] listens on all IPv4 and IPv6 interfaces \, but you can restrict it to a specific interface \, e.g. "127.0.0.1" to only receive IPv4 messages from the same computer.;
#X text 574 10 [netreceive] accepts a hostname which can be a UDP multicast address or a network interface. Note that you can't specify a remote host - that is the job of a firewall.;
#X msg 26 156 timeout 3000;
#X text 121 156 TCP connect timeout in ms (don't set it too low);
#X obj 195 478 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 58 416 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 87 283 send value;
#X floatatom 987 404 4 0 0 0 - - - 0;
#X msg 73 235 disconnect;
#X text 26 82 [netsend] supports sending IPv6 and multicast messages and will try to detect the IP version based on the given address or hostname. Hostname resolution favors IPv4 results for backwards compatibility in both [netsend] and [netreceive]., f 71;
#X obj 593 381 netreceive -u -f 3005;
#X obj 737 410 print Address/Port, f 11;
#X obj 593 418 print UDP-hostname;
#X obj 843 405 print TCP-hostname;
#X text 342 401 send value;
#X connect 0 0 37 0;
#X connect 1 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 0 0;
#X connect 9 0 0 0;
#X connect 13 0 38 0;
#X connect 14 0 13 0;
#X connect 15 0 13 0;
#X connect 19 0 43 0;
#X connect 20 0 43 0;
#X connect 21 0 43 0;
#X connect 22 0 43 0;
#X connect 23 0 43 0;
#X connect 24 0 43 0;
#X connect 26 0 46 0;
#X connect 26 1 40 0;
#X connect 28 0 43 0;
#X connect 35 0 13 0;
#X connect 41 0 13 0;
#X connect 43 0 45 0;
#X connect 43 1 44 0;
#X restore 251 488 pd IPv6/multicast;
#X msg 440 155 connect localhost 3000;
#X obj 649 308 netreceive -f 3000, f 22;
#X text 120 11 - send messages over a network connection;
#X text 740 183 <-- set or change port (can also be set via argument), f 27;
#X obj 829 310 print Address/Port;
#X text 469 223 lists send messages;
#X text 22 464 As of 0.51 \, Pd supports IPv6 addresses. Open subpatch for more details:, f 40;
#X text 859 416 An old (pre-0.45) calling convention is provided for compatibility: a "0" or "1" for TCP or UDP respectively (as a single argument for [netsend] or as a second argument for [netreceive]:, f 27;
#X obj 888 554 netreceive 3002 1;
#X text 899 577 (UDP port 3002);
#X text 13 82 The [netsend] object sends TCP ("stream") or UDP ("datagram") messages over the network \, which can be received by [netreceive] objects on another machine running Pd. You can also use [netsend]/[netreceive] for intercommunication with other software on your machine (which can also be a different version/fork of Pd)., f 53;
#X msg 494 271 1 2 3 4;
#X text 13 380 The "-b" flag specifies binary messages instead of FUDI \, open subpatch below to see how this works., f 53;
#X obj 649 363 print TCP-FUDI;
#X obj 491 566 print UDP-FUDI;
#X text 414 432 The '-u' flag sets to UDP mode - [netreceive] can't send messages back in this mode and doesn't have an outlet for number of connections. For connection back to a sender se subpacth below to the left., f 33;
#X text 20 541 For connection back to a sender in UDP \, open subpacth :, f 31;
#N canvas 168 227 683 317 send-back-in-UDP 0;
#X obj 27 198 netsend -u -b;
#X msg 65 152 1 2 3;
#X obj 294 247 netsend -u -b;
#X msg 325 208 1 2 3;
#X listbox 115 235 10 0 0 0 - - - 0;
#X obj 115 268 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X listbox 496 207 11 0 0 0 - - - 0;
#X msg 49 104 disconnect;
#X obj 496 237 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X msg 27 62 connect localhost 3006 3007;
#X msg 294 122 connect localhost 3007;
#X obj 496 169 netreceive -u -b 3006;
#X msg 312 167 disconnect;
#X text 390 200 send back to sender, f 9;
#X text 368 207 <--;
#X text 285 24 An additional port argument is possible in the 'connect' message for UDP connections so you can have messages sent back from the receiver patch \, but we do this with another [netsend] object., f 47;
#X text 462 115 connect to port to talk back to sender, f 19;
#X text 34 19 connect to receiver and port to listen back., f 23;
#X connect 0 1 4 0;
#X connect 1 0 0 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 6 0 8 0;
#X connect 7 0 0 0;
#X connect 9 0 0 0;
#X connect 10 0 2 0;
#X connect 11 0 6 0;
#X connect 12 0 2 0;
#X restore 197 562 pd send-back-in-UDP;
#X connect 11 0 23 0;
#X connect 11 1 14 0;
#X connect 12 0 11 0;
#X connect 16 0 48 0;
#X connect 18 0 48 0;
#X connect 23 0 22 0;
#X connect 25 0 27 0;
#X connect 26 0 27 0;
#X connect 27 0 35 0;
#X connect 28 0 32 0;
#X connect 32 0 27 0;
#X connect 37 0 48 0;
#X connect 38 0 11 0;
#X connect 39 0 38 0;
#X connect 41 0 61 0;
#X connect 47 0 11 0;
#X connect 48 0 60 0;
#X connect 48 1 15 0;
#X connect 48 2 51 0;
#X connect 58 0 38 0;
