CheckTopology() private static method

private static CheckTopology ( HostTopology topology ) : void
topology HostTopology
return void
コード例 #1
0
        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);
        }
コード例 #2
0
        public static int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port, string ip)
        {
            bool flag = topology == null;

            if (flag)
            {
                throw new NullReferenceException("topology is not defined");
            }
            NetworkTransport.CheckTopology(topology);
            return(NetworkTransport.AddHostInternal(new HostTopologyInternal(topology), ip, port, minTimeout, maxTimeout));
        }
コード例 #3
0
        public static int AddHost(HostTopology topology, [DefaultValue("0")] int port, [DefaultValue("null")] string ip)
        {
            if (topology == null)
            {
                throw new NullReferenceException("topology is not defined");
            }
            NetworkTransport.CheckTopology(topology);
            int result;

            if (ip == null)
            {
                result = NetworkTransport.AddHostWrapperWithoutIp(new HostTopologyInternal(topology), port, 0, 0);
            }
            else
            {
                result = NetworkTransport.AddHostWrapper(new HostTopologyInternal(topology), ip, port, 0, 0);
            }
            return(result);
        }
コード例 #4
0
        public static int AddWebsocketHost(HostTopology topology, int port, string ip)
        {
            bool flag = port != 0;

            if (flag)
            {
                bool flag2 = NetworkTransport.IsPortOpen(ip, port);
                if (flag2)
                {
                    throw new InvalidOperationException("Cannot open web socket on port " + port.ToString() + " It has been already occupied.");
                }
            }
            bool flag3 = topology == null;

            if (flag3)
            {
                throw new NullReferenceException("topology is not defined");
            }
            NetworkTransport.CheckTopology(topology);
            return(NetworkTransport.AddWsHostInternal(new HostTopologyInternal(topology), ip, port));
        }