Browse Source

Supply the strerror as a second arg to the tcp.Connection close event

v0.7.4-release
Johan Sørensen 15 years ago
committed by Ryan Dahl
parent
commit
04f9c9fb09
  1. 8
      src/node_net.cc

8
src/node_net.cc

@ -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() {

Loading…
Cancel
Save