node/lib/tcp.js

13 lines
362 B
JavaScript
Raw Normal View History

2009-09-28 22:08:09 +08:00
exports.createServer = function (on_connection, options) {
var server = new process.tcp.Server();
2009-09-28 22:08:09 +08:00
server.addListener("connection", on_connection);
//server.setOptions(options);
return server;
};
exports.createConnection = function (port, host) {
var connection = new process.tcp.Connection();
2009-09-28 22:08:09 +08:00
connection.connect(port, host);
return connection;
};