Beispiel #1
0
        void Cleanup()
        {
            if (sender != null)
            {
                sender.Dispose();
                sender = null;
            }
            mToEcho = ConnectionId.INVALID;

            mTargetPackagesCounter = 0;
            mIsActive           = false;
            mStartTime          = DateTime.Now;
            mBytesReceived      = 0;
            mUnexpectedMessages = 0;
            mDroppedMessages    = 0;
            mNumberSent         = 0;
            mNumberReceived     = 0;
            mExpectedToReceive  = 0;
            mBufferFull         = false;
            mAverageTimer       = 0;
            mSumBytesSent       = 0;
            mSumBytesConfirmed  = 0;
            mSumBytesReceived   = 0;
            mBufferFullCount    = 0;
            mAwaitingMessage    = new HashSet <Msg>();
        }
Beispiel #2
0
 public void Cleanup()
 {
     if (mCall != null)
     {
         mCall.Dispose();
         mCall = null;
     }
 }
Beispiel #3
0
        private void Cleanup()
        {
            if (echo != null)
            {
                echo.Dispose();
                echo = null;
            }
            mToSender  = ConnectionId.INVALID;
            mActive    = false;
            mConnected = false;

            mStatReceived = 0;
            mStatDropped  = 0;

            mAverageTimer    = 0;
            mSumBytesRec     = 0;
            mStatAvgReceived = 0;
        }
 /// <summary>
 /// Destroys the call. Used if unity destroys the object or if a call
 /// ended / failed due to an error.
 ///
 /// </summary>
 private void CleanupCall()
 {
     if (mCall != null)
     {
         Debug.Log("Destroying call!");
         mCall.Dispose();
         mCall = null;
         Debug.Log("Call destroyed");
     }
 }
Beispiel #5
0
 private void Disconnect()
 {
     if (caller != null)
     {
         caller.CallEvent -= HandleCallEvent;
         caller.Dispose();
         caller = null;
         GC.Collect();
         GC.WaitForPendingFinalizers();
     }
 }
Beispiel #6
0
 private void OnDestroy()
 {
     //STEP9: GameObject is being destroyed either due to user action, another script or
     //because Unity shuts down -> end the calls + cleanup memory
     //This step is extremely important and not cleaning up might
     //cause stalls or crashes. It will also keep the users webcam active thus
     //preventing other apps from accessing it
     if (receiver != null)
     {
         receiver.Dispose();
         receiver = null;
     }
     if (sender != null)
     {
         sender.Dispose();
         sender = null;
     }
 }
Beispiel #7
0
 /// <summary>
 /// Destroys the call. Used if unity destroys the object or if a call
 /// ended / failed due to an error.
 ///
 /// </summary>
 protected virtual void CleanupCall()
 {
     if (mCall != null)
     {
         mCallActive   = false;
         mRemoteUserId = ConnectionId.INVALID;
         Debug.Log("Destroying call!");
         mCall.CallEvent -= Call_CallEvent;
         mCall.Dispose();
         mCall = null;
         //call the garbage collector. This isn't needed but helps discovering
         //memory bugs early on.
         Debug.Log("Triggering garbage collection");
         GC.Collect();
         GC.WaitForPendingFinalizers();
         Debug.Log("Call destroyed");
     }
 }