This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TCP = process.binding("tcp_wrap").TCP; | |
try { | |
var crypto = process.binding("crypto"); | |
var SecureContext = crypto.SecureContext; | |
} catch (e) { | |
throw new Error("node.js not compiled with openssl crypto support."); | |
} | |
function noop() {}; | |
function createCredentials(key, cert, ciphers) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require("net"); | |
var TCP = process.binding("tcp_wrap").TCP; | |
var Pipe = process.binding("pipe_wrap").Pipe; | |
var sock1 = new TCP(); | |
sock1.bind("0.0.0.0", 80); | |
var sock2 = new Pipe(); | |
sock2.bind("/tmp/handle.sock"); | |
var server1 = net.createServer(function(c) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FTPServer = require("nodeftpd").Server; | |
var options = { | |
host: "localhost", | |
pasvip: "127.0.0.1", | |
port: 21, | |
portrange: { | |
lo: 1025, | |
hi: 2048 | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TCP = process.binding("tcp_wrap").TCP; | |
var Buffer = process.binding("buffer").SlowBuffer; | |
var HTTPParser = process.binding("http_parser").HTTPParser; | |
function setupSocket(peer) { | |
function shutdownHandler(status, handle, req) { | |
// TODO: ensure we only shutdown once | |
if(status != 0) { | |
if(peer.onerror) { | |
var err = new Error("shutdown"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res.writeHead(200); | |
throw(new Error("poof!")); | |
res.end(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
http.createServer(function (req, res) { | |
console.log(require("url").parse(req.url, true)); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(80, '0.0.0.0'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test.js: | |
29,222,676 calls per second | |
test-named: | |
50,505,050 calls per second | |
test-streamline.js: | |
332,557 calls per second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var fs = require('fs'); | |
var cache = {}, hit = 0, missed = 0; | |
var count = parseInt(process.argv[2]) || 1000000; | |
var fname = __dirname + "/benchCallbacks.js"; | |
function bench(cb) { | |
var total = 0; | |
var current = 0; | |
function handleResult(err, data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/oracle_bindings.cpp b/src/oracle_bindings.cpp | |
old mode 100644 | |
new mode 100755 | |
index bbcf611..1ea38a2 | |
--- a/src/oracle_bindings.cpp | |
+++ b/src/oracle_bindings.cpp | |
@@ -84,6 +84,7 @@ void OracleClient::EIO_Connect(uv_work_t* req) { | |
std::ostringstream connectionStr; | |
connectionStr << "//" << baton->hostname << ":" << baton->port << "/" << baton->database; | |
baton->connection = baton->environment->createConnection(baton->user, baton->password, connectionStr.str()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.sliceAfter = function(expr) { | |
var index = 0; | |
var found = this.some(function(v, i, a) { | |
if(v > expr) { | |
index = i; | |
return true; | |
} | |
}); | |
if(!found) return []; | |
return this.slice(index); |