summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2014-08-20 14:02:48 -0700
committerAura Linden <aura@lindenlab.com>2014-08-20 14:02:48 -0700
commit86e2bd75bc6a04fa175a0ac9df51371498355f58 (patch)
tree7045852128fd0a4c56a28835b4e2aa81f6529202 /indra
parenteba76107ba2d40998f28582d85d6b9f5b6188263 (diff)
Wait for response from SLVoice when sending shutdown.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llvoicevivox.cpp15
-rwxr-xr-xindra/newview/llvoicevivox.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index efe4f15b00..642c6c1f76 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -323,6 +323,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mCaptureBufferRecording(false),
mCaptureBufferRecorded(false),
mCaptureBufferPlaying(false),
+ mShutdownComplete(true),
mPlayRequestCount(0),
mAvatarNameCacheConnection()
@@ -377,7 +378,14 @@ void LLVivoxVoiceClient::terminate()
if(mConnected)
{
logout();
- connectorShutdown();
+ connectorShutdown();
+ int count=0;
+ while (!mShutdownComplete && 10 > count++)
+ {
+ stateMachine();
+ _sleep(1000);
+ }
+
closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
cleanUp();
}
@@ -512,6 +520,7 @@ void LLVivoxVoiceClient::connectorShutdown()
<< "</Request>"
<< "\n\n\n";
+ mShutdownComplete = false;
mConnectorHandle.clear();
writeString(stream.str());
@@ -1564,6 +1573,7 @@ void LLVivoxVoiceClient::stateMachine()
//MARK: stateConnectorStopping
case stateConnectorStopping: // waiting for connector stop
// The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped.
+ mShutdownComplete = true;
break;
//MARK: stateConnectorStopped
@@ -1643,9 +1653,6 @@ void LLVivoxVoiceClient::stateMachine()
void LLVivoxVoiceClient::closeSocket(void)
{
-#ifdef LL_WINDOWS
- _sleep(3000); //Wait a moment for socket to close.
-#endif
mSocket.reset();
mConnected = false;
mConnectorHandle.clear();
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 10ebac730d..a4ec9f2a69 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -723,6 +723,7 @@ private:
bool mRenderDeviceDirty;
bool mIsInitialized;
+ bool mShutdownComplete;
bool checkParcelChanged(bool update = false);