Sha256: e1bbccb2b1a59cf36b685745b733991a2b3cf763338b93f53421853e15f18045

Contents?: true

Size: 804 Bytes

Versions: 85

Compression:

Stored size: 804 Bytes

Contents

//Setup a server on port 9998 to accept incomming connections
var io = require('socket.io')();
var rl = require('readline');

var r = rl.createInterface({
  input: process.stdin,
  output: new require('stream').Writable(),
  terminal: false
});

var stdin = process.stdin;

_socket = null;

//stdin.resume();
r.on("line", function(chunk) {
  var res = JSON.parse(chunk.toString());
  type = res.type;
  msg = res.msg;
  console.error("Sending" + type);
  console.error("Sending" + JSON.stringify(msg));
  _socket.emit(type, msg);
});

io.on('connection', function(socket) {
  _socket = socket;
  console.log("CLIENT CONNECTED");

  socket.on("test", function(data) {
    console.log(JSON.stringify(data));
  });
});
io.listen(9998);

function call() {
  console.log("STARTED");
}
setTimeout(call, 1000);

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
flok-0.0.105 spec/iface/driver/assets/sockio_server.js
flok-0.0.103 spec/iface/driver/assets/sockio_server.js
flok-0.0.102 spec/iface/driver/assets/sockio_server.js
flok-0.0.101 spec/iface/driver/assets/sockio_server.js
flok-0.0.100 spec/iface/driver/assets/sockio_server.js
flok-0.0.99 spec/iface/driver/assets/sockio_server.js
flok-0.0.98 spec/iface/driver/assets/sockio_server.js
flok-0.0.97 spec/iface/driver/assets/sockio_server.js
flok-0.0.96 spec/iface/driver/assets/sockio_server.js
flok-0.0.95 spec/iface/driver/assets/sockio_server.js
flok-0.0.94 spec/iface/driver/assets/sockio_server.js
flok-0.0.93 spec/iface/driver/assets/sockio_server.js
flok-0.0.92 spec/iface/driver/assets/sockio_server.js
flok-0.0.91 spec/iface/driver/assets/sockio_server.js
flok-0.0.90 spec/iface/driver/assets/sockio_server.js
flok-0.0.89 spec/iface/driver/assets/sockio_server.js
flok-0.0.88 spec/iface/driver/assets/sockio_server.js
flok-0.0.87 spec/iface/driver/assets/sockio_server.js
flok-0.0.86 spec/iface/driver/assets/sockio_server.js
flok-0.0.85 spec/iface/driver/assets/sockio_server.js