diff --git a/src/AppWrapper.h b/src/AppWrapper.h index 804d069c..26ff0170 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -305,6 +305,14 @@ void uWS_App_get(F f, const FunctionCallbackInfo &args) { args.GetReturnValue().Set(args.Holder()); } +template +void uWS_App_close(const FunctionCallbackInfo &args) { + APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0); + + app->close(); + args.GetReturnValue().Set(args.Holder()); +} + template void uWS_App_listen(const FunctionCallbackInfo &args) { APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0); @@ -628,6 +636,7 @@ void uWS_App(const FunctionCallbackInfo &args) { }, args.Data())); appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "listen", NewStringType::kNormal).ToLocalChecked(), FunctionTemplate::New(isolate, uWS_App_listen, args.Data())); + appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "close", NewStringType::kNormal).ToLocalChecked(), FunctionTemplate::New(isolate, uWS_App_close, args.Data())); if constexpr (!std::is_same::value) { diff --git a/uWebSockets b/uWebSockets index 7a363a8b..a703f6c4 160000 --- a/uWebSockets +++ b/uWebSockets @@ -1 +1 @@ -Subproject commit 7a363a8b10df4f77377d5905125007f374951760 +Subproject commit a703f6c493a4eb4e125bdf590b5c864e3a1f8aa2