PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/node-websocket-client/examples/client-unix.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
JavaScript | 12 lines | 9 code | 3 blank | 0 comment | 0 complexity | 319d188ea0ffaf63bd721904413e74a0 MD5 | raw file
 1var sys = require('sys');
 2var WebSocket = require('../lib/websocket').WebSocket;
 3
 4var ws = new WebSocket('ws+unix://' + process.argv[2], 'boffo');
 5
 6ws.addListener('message', function(d) {
 7    sys.debug('Received message: ' + d.toString('utf8'));
 8});
 9
10ws.addListener('open', function() {
11    ws.send('This is a message', 1);
12});