Skip to content

Commit

Permalink
Supply the strerror as a second arg to the tcp.Connection close event
Browse files Browse the repository at this point in the history
  • Loading branch information
js authored and ry committed Nov 13, 2009
1 parent 06d493e commit 04f9c9f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/node_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,12 @@ void Connection::OnReceive(const void *buf, size_t len) {
void Connection::OnClose() {
HandleScope scope;

Handle<Value> argv[1];
argv[0] = stream_.errorno == 0 ? False() : True();
Handle<Value> argv[2] = {
stream_.errorno == 0 ? False() : True(),
String::New(strerror(stream_.errorno))
};

Emit("close", 1, argv);
Emit("close", 2, argv);
}

void Connection::OnConnect() {
Expand Down

0 comments on commit 04f9c9f

Please sign in to comment.