mirror of https://github.com/nodejs/node.git
Supply the strerror as a second arg to the tcp.Connection close event
parent
06d493e7e3
commit
04f9c9fb09
|
@ -447,10 +447,12 @@ void Connection::OnReceive(const void *buf, size_t len) {
|
||||||
void Connection::OnClose() {
|
void Connection::OnClose() {
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
|
|
||||||
Handle<Value> argv[1];
|
Handle<Value> argv[2] = {
|
||||||
argv[0] = stream_.errorno == 0 ? False() : True();
|
stream_.errorno == 0 ? False() : True(),
|
||||||
|
String::New(strerror(stream_.errorno))
|
||||||
|
};
|
||||||
|
|
||||||
Emit("close", 1, argv);
|
Emit("close", 2, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Connection::OnConnect() {
|
void Connection::OnConnect() {
|
||||||
|
|
Loading…
Reference in New Issue