Mercurial > hg > beaglert
comparison resources/osc/node_modules/osc-min/examples/printosc.coffee @ 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 osc = require 'osc-min' | |
2 udp = require "dgram" | |
3 | |
4 if process.argv[2]? | |
5 inport = parseInt process.argv[2] | |
6 else | |
7 inport = 41234 | |
8 | |
9 console.log "OSC listener running at http://localhost:" + inport | |
10 | |
11 `//~verbatim:examples[0]~ | |
12 //### A simple OSC printer` | |
13 sock = udp.createSocket "udp4", (msg, rinfo) -> | |
14 try | |
15 console.log osc.fromBuffer msg | |
16 catch error | |
17 console.log "invalid OSC packet" | |
18 sock.bind inport |