public Client(ThreadStart rcvThreadProc) { comm = new CommService <Client>(); endPoint = CommService <Client> .makeEndPoint("http://localhost", 4038); comm.rcvr.CreateRecvChannel(endPoint); comm.rcvr.StartRcvThead(rcvThreadProc); }
public TestHarness() { Console.Title = "TestHareness Server"; streamproxy = CreateClientFileServiceChannel("http://localhost:8000/StreamService"); comm = new CommService <TestHarness>(); endPoint = CommService <TestHarness> .makeEndPoint("http://localhost", 4040); comm.rcvr.CreateRecvChannel(endPoint); comm.rcvr.StartRcvThead(rcvThreadProc); }
Client client; //for msg communication public MainWindow() { InitializeComponent(); //----------as a host, listen to channel to receive test result msg --------- Console.Title = "client 2 demo"; client = new Client(rcvThreadProc); //--------as a client, sending test request msg------------------------- for (int i = 0; i < 10; i++) { client.MakeMessage("Yaodong", "testrequest", client.endPoint, CommService <Client> .makeEndPoint("http://localhost", 4040)); client.comm.sndr.PostMessage(client.requestMsg);// put into sndBlockingQ, if there is any msg in the queue, a thread will deal with it. Thread.Sleep(400); } }