public void run() { for (int i = 0; i < 3; i++) { ServiceApi rpc = new ServiceApi(); //if (!rpc.transport.IsOpen) //{ // rpc.transport.Open(); //} rpc.client.setLoadInfo(1, "2"); ////rpc.CloseConn(); //Console.WriteLine("Thread2____"+i); } }
//private static Object gisLock = new Object(); public void run() { //Monitor.Enter(gisLock); for (int i = 0; i < 3; i++) { ServiceApi rpc = new ServiceApi(); //if (!rpc.transport.IsOpen) //{ // rpc.transport.Open(); //} rpc.client.setLoadInfo(1, "1"); ////rpc.CloseConn(); //Console.WriteLine("Thread1_____"+i); } Thread.Sleep(2000); }