AddWsHostWrapperWithoutIp() приватный Метод

private AddWsHostWrapperWithoutIp ( HostTopologyInternal topologyInt, int port ) : int
topologyInt HostTopologyInternal
port int
Результат int
        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 AddWebsocketHost(HostTopology topology, int port, [DefaultValue("null")] string ip)
 {
     if (topology == null)
     {
         throw new NullReferenceException("topology is not defined");
     }
     if (ip == null)
     {
         return(NetworkTransport.AddWsHostWrapperWithoutIp(new HostTopologyInternal(topology), port));
     }
     return(NetworkTransport.AddWsHostWrapper(new HostTopologyInternal(topology), ip, port));
 }