diff --git a/src/node_net.cc b/src/node_net.cc index 78b17188850..a39af86228e 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -447,10 +447,12 @@ void Connection::OnReceive(const void *buf, size_t len) { void Connection::OnClose() { HandleScope scope; - Handle argv[1]; - argv[0] = stream_.errorno == 0 ? False() : True(); + Handle argv[2] = { + stream_.errorno == 0 ? False() : True(), + String::New(strerror(stream_.errorno)) + }; - Emit("close", 1, argv); + Emit("close", 2, argv); } void Connection::OnConnect() {