From a13b497b311448bfea18da5c8cefabf7035b6fb2 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Tue, 7 Dec 2021 21:11:38 +0100 Subject: [PATCH] Wrap sendPingsAutomatically --- src/AppWrapper.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index d36a5d3..233da48 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -72,6 +72,12 @@ void uWS_App_ws(const FunctionCallbackInfo &args) { behavior.closeOnBackpressureLimit = maybeCloseOnBackpressureLimit.ToLocalChecked()->Int32Value(isolate->GetCurrentContext()).ToChecked(); } + /* sendPingsAutomatically or default */ + MaybeLocal maybeSendPingsAutomatically = behaviorObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "sendPingsAutomatically", NewStringType::kNormal).ToLocalChecked()); + if (!maybeSendPingsAutomatically.IsEmpty() && !maybeSendPingsAutomatically.ToLocalChecked()->IsUndefined()) { + behavior.sendPingsAutomatically = maybeSendPingsAutomatically.ToLocalChecked()->Int32Value(isolate->GetCurrentContext()).ToChecked(); + } + /* Compression or default, map from 0, 1, 2 to disabled, shared, dedicated. This is actually the enum */ MaybeLocal maybeCompression = behaviorObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "compression", NewStringType::kNormal).ToLocalChecked()); if (!maybeCompression.IsEmpty() && !maybeCompression.ToLocalChecked()->IsUndefined()) {