From 48b4ac4a8d6e277e522687ee6ef914b698d6493f Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 22 Apr 2009 14:09:17 +0200 Subject: [PATCH] implment server.close --- src/net.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/net.cc b/src/net.cc index 81bba006b9..38db31a32c 100644 --- a/src/net.cc +++ b/src/net.cc @@ -167,7 +167,11 @@ Server::ListenTCP (const Arguments& args) Handle Server::Close (const Arguments& args) { + Server *server = Server::Unwrap(args.Holder()); + + oi_server_close(&server->server_); + return Undefined(); } oi_socket* @@ -449,7 +453,6 @@ Socket::Write (const Arguments& args) oi_socket_write(&socket->socket_, buf); } else return ThrowException(String::New("Bad argument")); - return Undefined(); } @@ -610,5 +613,6 @@ NodeInit_net (Handle target) target->Set(String::NewSymbol("Server"), server_template->GetFunction()); NODE_SET_METHOD(server_template->InstanceTemplate(), "listenTCP", Server::ListenTCP); + NODE_SET_METHOD(server_template->InstanceTemplate(), "close", Server::Close); }