refactor(terminal) module.exports

This commit is contained in:
coderaiser 2014-09-12 08:39:38 -04:00
parent d3dd66563c
commit a03e44278b

View file

@ -21,16 +21,16 @@
ConNum = 0;
module.exports = function(socket) {
var makePty = function(socket) {
onConnection(socket, function(channel, data) {
socket.emit(channel, data);
});
};
Util.checkArgs(arguments, ['socket']);
if (pty)
socket
.of('/terminal')
.on('connection', makePty);
.on('connection', function(socket) {
onConnection(socket, function(channel, data) {
socket.emit(channel, data);
});
});
};
function onConnection(socket, callback) {