예제 #1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine(
                    "Usage:   -lae <LocalAETtile> -rae <ServerAE> -h <ServerHost> -p <ServerPort> [-n <NumberOfClients>] [-d DelayBetweenCalls] [-suid <StudyUIDToRetrieve>] ");
                return;
            }
            Dictionary <string, string> parms = ParseArguments(args);
            Random r           = new Random();
            int    clientCount = parms.ContainsKey("-n")? Int32.Parse(parms["-n"]) : r.Next(20) + 1;

            Console.WriteLine("{0} clients", clientCount);



            for (int i = 0; i < clientCount; i++)
            {
                HeaderTestClient testClient = new HeaderTestClient();
                testClient.LocalAE    = parms["-lae"] + "-" + i;
                testClient.RemoteAE   = parms["-rae"];
                testClient.RemoteHost = parms["-h"];
                testClient.RemotePort = Int32.Parse(parms["-p"]);

                if (parms.ContainsKey("-d"))
                {
                    testClient.Delay = Int32.Parse(parms["-d"]);
                }
                else
                {
                    testClient.Delay = 500;
                }

                if (parms.ContainsKey("-suid"))
                {
                    testClient.FixedStudyInstanceUid = parms["-suid"];
                }


                Thread t = new Thread(delegate()
                {
                    testClient.Run();
                });

                t.Start();
                Thread.Sleep(r.Next(200));
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: nhannd/Xian
        static void Main(string[] args)
        {
            if (args.Length==0)
            {
                Console.WriteLine(
                    "Usage:   -lae <LocalAETtile> -rae <ServerAE> -h <ServerHost> -p <ServerPort> [-n <NumberOfClients>] [-d DelayBetweenCalls] [-suid <StudyUIDToRetrieve>] ");
                return;
            }
            Dictionary<string, string> parms = ParseArguments(args);
            Random r = new Random();
            int clientCount = parms.ContainsKey("-n")? Int32.Parse(parms["-n"]) : r.Next(20) + 1;
            
            Console.WriteLine("{0} clients", clientCount);

            

            for(int i=0; i<clientCount; i++)
            {
                HeaderTestClient testClient = new HeaderTestClient();
                testClient.LocalAE = parms["-lae"] + "-" + i;
                testClient.RemoteAE = parms["-rae"];
                testClient.RemoteHost = parms["-h"];
                testClient.RemotePort = Int32.Parse(parms["-p"]);

                if (parms.ContainsKey("-d"))
                {
                    testClient.Delay = Int32.Parse(parms["-d"]);
                }
                else
                {
                    testClient.Delay = 500;
                }

                if (parms.ContainsKey("-suid"))
                {
                    testClient.FixedStudyInstanceUid = parms["-suid"];
                }


                Thread t = new Thread(delegate()
                                          {
                                              testClient.Run();
                                          });

                t.Start();
                Thread.Sleep(r.Next(200));
            }

        }