io.sockets.on('connection', function (socket) {
console.log('Webpage connected'); //Confirmation that the socket has
connection to the webpage
mySocket = socket;});
//UDP server on 41181var dgram = require("dgram");var server =
dgram.createSocket("udp4");
server.on("message", function (msg, rinfo) {
console.log("Broadcasting Message: " + msg); //Display the message coming
from the terminal to the command line for debugging
if (mySocket != 0) {
mySocket.emit('field', "" + msg);
mySocket.broadcast.emit('field', "" + msg); //Display the message from the
terminal to the webpage
}});
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/a3dfd4d9-ea03-4f8b-b026-35c90e889d07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.