diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2020-05-27 12:36:59 -0400 | 
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2020-05-27 12:36:59 -0400 | 
| commit | 1f4fbc8d11d37efbd6c2f2336f33b7e2eb010986 (patch) | |
| tree | 67e433aaad8d4b922fc361ea90cffeb19c2a02e7 | |
| parent | 095630411c4ff206f44f4b5e537890cb38048f06 (diff) | |
DRTVWR-476, VOICE-88, SL-13025: Use a new port every SLVoice launch.
The observed failure is that SLVoice, on relaunch, produces an error that
bind() returned EADDRINUSE and terminates. Using a different port every time
we relaunch avoids that collision.
| -rw-r--r-- | indra/newview/llvoicevivox.cpp | 17 | 
1 files changed, 16 insertions, 1 deletions
| diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 27cc19072f..42a1cf95a7 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -806,6 +806,21 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()              LLProcess::Params params;              params.executable = exe_path; +            // VOICE-88: Cycle through [portbase..portbase+portrange) on +            // successive tries because attempting to relaunch (after manually +            // disabling and then re-enabling voice) with the same port can +            // cause SLVoice's bind() call to fail with EADDRINUSE. We expect +            // that eventually the OS will time out previous ports, which is +            // why we cycle instead of incrementing indefinitely. +            U32 portbase = gSavedSettings.getU32("VivoxVoicePort"); +            static U32 portoffset = 0; +            static const U32 portrange = 100; +            std::string host(gSavedSettings.getString("VivoxVoiceHost")); +            U32 port = portbase + portoffset; +            portoffset = (portoffset + 1) % portrange; +            params.args.add("-i"); +            params.args.add(STRINGIZE(host << ':' << port)); +              std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");              if (loglevel.empty())              { @@ -862,7 +877,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()              sGatewayPtr = LLProcess::create(params); -            mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort")); +            mDaemonHost = LLHost(host.c_str(), port);          }          else          { | 
