UnityEngine.Networking.NetworkTransport.RemoveHost C# (CSharp) Method

RemoveHost() private method

private RemoveHost ( int hostId ) : bool
hostId int
return bool
        public static extern bool RemoveHost(int hostId);
        public static bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error)

Usage Example

コード例 #1
0
        public void StopBroadcast()
        {
            if (m_HostId == -1)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("NetworkDiscovery StopBroadcast not initialized");
                }
                return;
            }

            if (!m_Running)
            {
                Debug.LogWarning("NetworkDiscovery StopBroadcast not started");
                return;
            }
            if (m_IsServer)
            {
                NetworkTransport.StopBroadcastDiscovery();
            }

            NetworkTransport.RemoveHost(m_HostId);
            m_HostId             = -1;
            m_Running            = false;
            m_IsServer           = false;
            m_IsClient           = false;
            m_MsgInBuffer        = null;
            m_BroadcastsReceived = null;
            if (LogFilter.logDebug)
            {
                Debug.Log("Stopped Discovery broadcasting");
            }
        }
All Usage Examples Of UnityEngine.Networking.NetworkTransport::RemoveHost