mirror of
https://github.com/uNetworking/uWebSockets.js.git
synced 2026-03-03 14:00:10 -05:00
Wrap app.close, update uWS
This commit is contained in:
@@ -305,6 +305,14 @@ void uWS_App_get(F f, const FunctionCallbackInfo<Value> &args) {
|
||||
args.GetReturnValue().Set(args.Holder());
|
||||
}
|
||||
|
||||
template <typename APP>
|
||||
void uWS_App_close(const FunctionCallbackInfo<Value> &args) {
|
||||
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
|
||||
|
||||
app->close();
|
||||
args.GetReturnValue().Set(args.Holder());
|
||||
}
|
||||
|
||||
template <typename APP>
|
||||
void uWS_App_listen(const FunctionCallbackInfo<Value> &args) {
|
||||
APP *app = (APP *) args.Holder()->GetAlignedPointerFromInternalField(0);
|
||||
@@ -628,6 +636,7 @@ void uWS_App(const FunctionCallbackInfo<Value> &args) {
|
||||
}, args.Data()));
|
||||
|
||||
appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "listen", NewStringType::kNormal).ToLocalChecked(), FunctionTemplate::New(isolate, uWS_App_listen<APP>, args.Data()));
|
||||
appTemplate->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "close", NewStringType::kNormal).ToLocalChecked(), FunctionTemplate::New(isolate, uWS_App_close<APP>, args.Data()));
|
||||
|
||||
if constexpr (!std::is_same<APP, uWS::H3App>::value) {
|
||||
|
||||
|
||||
Submodule uWebSockets updated: 7a363a8b10...a703f6c493
Reference in New Issue
Block a user