protected override void OnDisable()
    {
        isActive = false;
        mUdp.Stop();
        knownServers.Clear();
        if (onChange != null)
        {
            onChange();
        }

        if (mRequest != null)
        {
            mRequest.Recycle();
            mRequest = null;
        }
    }
예제 #2
0
    protected override void OnDisable()
    {
        isActive = false;
        base.OnDisable();

        try
        {
            mUdp.Stop();

            if (mRequest != null)
            {
                mRequest.Recycle();
                mRequest = null;
            }
            if (onChange != null)
            {
                onChange();
            }
        }
        catch (System.Exception) { }
    }
예제 #3
0
 private void OnDestroy()
 {
     TcpProtocol.Disconnect();
     UdpProtocol.Stop();
     upnp.Close();
 }