Skip to content

Commit a4089d6

Browse files
illwieckzslipher
authored andcommitted
VirtualMachine: make receive timeout configurable
1 parent 0cc7809 commit a4089d6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/engine/framework/VirtualMachine.cpp

Lines changed: 8 additions & 2 deletions
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::NONE, 2);
90+
8691
namespace VM {
8792

8893
// https://github.com/Unvanquished/Unvanquished/issues/944#issuecomment-744454772
@@ -502,8 +507,9 @@ void VMBase::Create()
502507

503508
// Only set a receive timeout for non-debug configurations, otherwise it
504509
// would get triggered by breakpoints.
505-
if (type != TYPE_NATIVE_DLL && !params.debug.Get())
506-
rootChannel.SetRecvTimeout(std::chrono::seconds(2));
510+
if (type != TYPE_NATIVE_DLL && !params.debug.Get()) {
511+
rootChannel.SetRecvTimeout(std::chrono::seconds(vm_timeout.Get()));
512+
}
507513

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

0 commit comments

Comments
 (0)