Mercurial > hg > beaglert
annotate resources/osc/node_modules/osc-min/examples/printosc.coffee @ 323:b99b8ab317dd prerelease
Using make commands within build_project.sh instead of explicit command lines
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Thu, 02 Jun 2016 02:15:40 +0100 |
parents | fb9c28a4676b |
children |
rev | line source |
---|---|
l@271 | 1 osc = require 'osc-min' |
l@271 | 2 udp = require "dgram" |
l@271 | 3 |
l@271 | 4 if process.argv[2]? |
l@271 | 5 inport = parseInt process.argv[2] |
l@271 | 6 else |
l@271 | 7 inport = 41234 |
l@271 | 8 |
l@271 | 9 console.log "OSC listener running at http://localhost:" + inport |
l@271 | 10 |
l@271 | 11 `//~verbatim:examples[0]~ |
l@271 | 12 //### A simple OSC printer` |
l@271 | 13 sock = udp.createSocket "udp4", (msg, rinfo) -> |
l@271 | 14 try |
l@271 | 15 console.log osc.fromBuffer msg |
l@271 | 16 catch error |
l@271 | 17 console.log "invalid OSC packet" |
l@271 | 18 sock.bind inport |