Exemple #1
0
        public static void Main()
        {
            Comm        comm = new Comm("http://localhost:", 8080);
            CommMessage msg  = new CommMessage(CommMessage.MessageType.connect);

            msg.from = "http://localhost:8080/BasicService";
            msg.to   = "http://localhost:8080/BasicService";
            comm.postMessage(msg);
            CommMessage msg1 = comm.getMessage();

            Console.Write("\n received message type is:" + msg1.type);
        }
Exemple #2
0
        public RepoMock()
        {
            Console.Write("\n------------------------Repository is started---------------------------\n");
            comm = new Comm("http://localhost", 9070);
            string[]    buildRequests = Directory.GetFiles(Path.Combine(Path.GetFullPath(repoStorage), "BuildRequests"), "*BuildRequest*.xml");
            CommMessage commMessage   = new CommMessage(CommMessage.MessageType.BuildRequest);

            commMessage.from = "http://localhost:9070/BasicService";
            commMessage.to   = "http://localhost:9080/BasicService";
            foreach (string buildRequest in buildRequests)
            {
                CommMessage commMsg = commMessage.Clone();
                commMsg.body     = File.ReadAllText(buildRequest);
                commMsg.fileName = Path.GetFileName(buildRequest);
                comm.postMessage(commMsg);
            }
            receiverThread = new Thread(receiverThreadProc);
            receiverThread.Start();
        }