Skip to content

Commit a93f12d

Browse files
committed
VirtualMachine: make receive timeout configurable
1 parent 068d0ea commit a93f12d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/engine/framework/VirtualMachine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ static Cvar::Cvar<bool> vm_nacl_bootstrap(
8383
"Use NaCl bootstrap helper",
8484
Cvar::INIT, true);
8585

86+
static Cvar::Cvar<int> vm_timeout(
87+
"vm.timeout",
88+
"Receive timeout in seconds",
89+
Cvar::INIT, 2);
90+
8691
namespace VM {
8792

8893
// https://github.com/Unvanquished/Unvanquished/issues/944#issuecomment-744454772
@@ -503,7 +508,7 @@ void VMBase::Create()
503508
// Only set a receive timeout for non-debug configurations, otherwise it
504509
// would get triggered by breakpoints.
505510
if (type != TYPE_NATIVE_DLL && !params.debug.Get())
506-
rootChannel.SetRecvTimeout(std::chrono::seconds(2));
511+
rootChannel.SetRecvTimeout(std::chrono::seconds(vm_timeout.Get()));
507512

508513
// Read the ABI version detection ABI version from the root socket.
509514
// If this fails, we assume the remote process failed to start

0 commit comments

Comments
 (0)