comparison resources/osc/node_modules/osc-min/examples/printosc.js @ 284:7bfb25a2e158 Doxy prerelease

Merge
author Robert Jack <robert.h.jack@gmail.com>
date Tue, 17 May 2016 15:53:24 +0100
parents fb9c28a4676b
children
comparison
equal deleted inserted replaced
269:ac8eb07afcf5 284:7bfb25a2e158
1 // Generated by CoffeeScript 1.10.0
2 var inport, osc, sock, udp;
3
4 osc = require('osc-min');
5
6 udp = require("dgram");
7
8 if (process.argv[2] != null) {
9 inport = parseInt(process.argv[2]);
10 } else {
11 inport = 41234;
12 }
13
14 console.log("OSC listener running at http://localhost:" + inport);
15
16 //~verbatim:examples[0]~
17 //### A simple OSC printer;
18
19 sock = udp.createSocket("udp4", function(msg, rinfo) {
20 var error, error1;
21 try {
22 return console.log(osc.fromBuffer(msg));
23 } catch (error1) {
24 error = error1;
25 return console.log("invalid OSC packet");
26 }
27 });
28
29 sock.bind(inport);