using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Runtime.InteropServices; using DccpLib; namespace Test { public class Testapp { public static void Main(string[] args) { if(args.Length!=3) { Console.WriteLine("3 argument required"); return; } using(DccpSocket socket = new DccpSocket(args[0], args[1], new PriorityQP(int.Parse(args[2])))) { DateTime expected = DateTime.Now; int waitTime = 20; for(int i=0;i<4000;i++) { string tosend=""+i%4+"000qwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuio_"+i.ToString("D4");; socket.Enqueue(Encoding.UTF8.GetBytes(tosend), i%4); Thread.Sleep(waitTime); expected = expected.AddMilliseconds(20); waitTime = Math.Max(0, 20 - (int)(DateTime.Now - expected).TotalMilliseconds); } } } } }