static void Main(string[] args) { Network n = new Network(); int count = 20; if (args.Length == 3) { count = int.Parse(args[0]); n.lossRate = double.Parse(args[1]); n.defaultTransitTime = int.Parse(args[2]); } //Console.WriteLine("Hello World"); Console.Beep(440, 100); Socket s1 = n.GenerateSocket(); s1.dst = 2; s1.id = 1; Socket s2 = n.GenerateSocket(); s2.dst = 1; s2.id = 2; while (count > 0) { s1.Send(); count--; } while (s1.hasMessages || n.hasMessages()) { n.Tick(); System.Threading.Thread.Sleep(250); n.Tick(); System.Threading.Thread.Sleep(250); } System.Threading.Thread.Sleep(5000); //Console.In.ReadLine(); }
public Socket(Network network,UInt16 SocketID) { this.network = network; this.id = SocketID; }
public Socket(Network network) { this.network = network; this.id = 0; }