From bb6057d9ad16c15f14e8665e9df24a49e428d96a Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 3 May 2009 01:11:39 +0200 Subject: [PATCH] rename Connection.disconnect -> Connection.close --- src/net.cc | 16 ++++++++-------- src/net.h | 6 +++--- test/test-pingpong.js | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/net.cc b/src/net.cc index 0df94bbb97..47b1aaa71b 100644 --- a/src/net.cc +++ b/src/net.cc @@ -54,7 +54,7 @@ Connection::Initialize (v8::Handle target) tcp_connection_constructor = Persistent::New(t->GetFunction()); NODE_SET_METHOD(t->InstanceTemplate(), "connect", Connection::v8Connect); - NODE_SET_METHOD(t->InstanceTemplate(), "disconnect", Connection::v8Disconnect); + NODE_SET_METHOD(t->InstanceTemplate(), "close", Connection::v8Close); NODE_SET_METHOD(t->InstanceTemplate(), "send", Connection::v8Send); NODE_SET_METHOD(t->InstanceTemplate(), "sendEOF", Connection::v8SendEOF); } @@ -169,11 +169,11 @@ Connection::v8Connect (const Arguments& args) * http://lists.schmorp.de/pipermail/libev/2009q1/000632.html */ eio_warmup(); - eio_req *req = eio_custom( Connection::Resolve - , EIO_PRI_DEFAULT - , Connection::AfterResolve - , connection - ); + eio_custom( Connection::Resolve + , EIO_PRI_DEFAULT + , Connection::AfterResolve + , connection + ); return Undefined(); } @@ -221,11 +221,11 @@ Connection::AfterResolve (eio_req *req) } Handle -Connection::v8Disconnect (const Arguments& args) +Connection::v8Close (const Arguments& args) { HandleScope scope; Connection *connection = NODE_UNWRAP(Connection, args.Holder()); - connection->Disconnect(); + connection->Close(); return Undefined(); } diff --git a/src/net.h b/src/net.h index 38cd43321e..45586971b5 100644 --- a/src/net.h +++ b/src/net.h @@ -13,7 +13,7 @@ public: Connection (v8::Handle handle); ~Connection () { - Disconnect(); + Close(); } int Connect (struct addrinfo *address) { @@ -28,7 +28,7 @@ public: oi_socket_write_eof (&socket_); } - void Disconnect (void) { + void Close (void) { oi_socket_close (&socket_); } @@ -37,7 +37,7 @@ protected: static v8::Handle v8Connect (const v8::Arguments& args); static v8::Handle v8Send (const v8::Arguments& args); static v8::Handle v8SendEOF (const v8::Arguments& args); - static v8::Handle v8Disconnect (const v8::Arguments& args); + static v8::Handle v8Close (const v8::Arguments& args); void OnConnect (void); void OnReceive (const void *buf, size_t len); diff --git a/test/test-pingpong.js b/test/test-pingpong.js index de2c3070ff..8ad2cf2500 100644 --- a/test/test-pingpong.js +++ b/test/test-pingpong.js @@ -1,7 +1,7 @@ include("mjsunit"); var port = 12123; -var N = 100; +var N = 1000; var count = 0; function Ponger (socket, server) { @@ -23,7 +23,7 @@ function Ponger (socket, server) { this.onEOF = function () { puts("ponger: onEOF"); socket.send("QUIT"); - socket.sendEOF(); + socket.close(); }; this.onDisconnect = function () {