Tag Archives: javascript

node.js 개발 (2)

간단한 echo 서버/클라이언트

server.js

/**
 * server.js
 * echo server
 * 
 * @require net
 */

var net = require('net');
var os = require('os');

var server = net.createServer();
var sockets = [];

console.log(os.platform());
console.log(os.arch());
console.log(os.totalmem());
console.log(os.freemem());
console.log(os.cpus());
console.log(os.networkInterfaces());

server.on('connection', function(socket) {