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

AddWsHostWrapperWithoutIp() private method

private AddWsHostWrapperWithoutIp ( HostTopologyInternal topologyInt, int port ) : int
topologyInt HostTopologyInternal
port int
return int
        private static extern int AddWsHostWrapperWithoutIp(HostTopologyInternal topologyInt, int port);
        private static void CheckTopology(HostTopology topology)

Usage Example

        public static int AddWebsocketHost(HostTopology topology, int port, [DefaultValue("null")] string ip)
        {
            if (port != 0)
            {
                if (NetworkTransport.IsPortOpen(ip, port))
                {
                    throw new InvalidOperationException("Cannot open web socket on port " + port + " It has been already occupied.");
                }
            }
            if (topology == null)
            {
                throw new NullReferenceException("topology is not defined");
            }
            NetworkTransport.CheckTopology(topology);
            int result;

            if (ip == null)
            {
                result = NetworkTransport.AddWsHostWrapperWithoutIp(new HostTopologyInternal(topology), port);
            }
            else
            {
                result = NetworkTransport.AddWsHostWrapper(new HostTopologyInternal(topology), ip, port);
            }
            return(result);
        }
All Usage Examples Of UnityEngine.Networking.NetworkTransport::AddWsHostWrapperWithoutIp