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); }
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)); }
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); }
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)); }