Skip to content

Instantly share code, notes, and snippets.

View lgomez's full-sized avatar

Luis G. Gómez lgomez

View GitHub Profile
@chrishulbert
chrishulbert / ssdp.node.js
Created March 30, 2011 21:46
Service discovery using node.js and ssdp / universal plug n play
var dgram = require('dgram'); // dgram is UDP
// Listen for responses
function listen(port) {
var server = dgram.createSocket("udp4");
server.on("message", function (msg, rinfo) {
console.log("server got: " + msg + " from " + rinfo.address + ":" + rinfo.port);
});
var win = Titanium.UI.currentWindow;
win.barColor = '#13386c';
win.backgroundColor = '#13386c';
var data = [];
var row = Ti.UI.createTableViewRow({height:'auto',backgroundColor:'#ffffff',selectedBackgroundColor:'#dddddd'});
var userName = Ti.UI.createLabel({
text: 'User Name',