mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
Supply the strerror as a second arg to the tcp.Connection close event
This commit is contained in:
1 parent
06d493e7e3
commit
04f9c9fb09
1 file changed
+5
-3
+5
-3
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user