UnityEngine.Networking.NetworkDiscovery.StopBroadcast C# (CSharp) Method

StopBroadcast() public method

Stops listening and broadcasting.

public StopBroadcast ( ) : void
return void
        public void StopBroadcast()
        {
            if (this.m_HostId == -1)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("NetworkDiscovery StopBroadcast not initialized");
                }
            }
            else if (!this.m_Running)
            {
                Debug.LogWarning("NetworkDiscovery StopBroadcast not started");
            }
            else
            {
                if (this.m_IsServer)
                {
                    NetworkTransport.StopBroadcastDiscovery();
                }
                NetworkTransport.RemoveHost(this.m_HostId);
                this.m_HostId = -1;
                this.m_Running = false;
                this.m_IsServer = false;
                this.m_IsClient = false;
                this.m_MsgInBuffer = null;
                this.m_BroadcastsReceived = null;
                if (LogFilter.logDebug)
                {
                    Debug.Log("Stopped Discovery broadcasting");
                }
            }
        }