public void RemoteObjectProxyTest1() { bool IsReady = false; Task t = new Task(() => { RemoteObjectsServer s = new RemoteObjectsServer(); s.Start(15111); // TODO: get free port s.GetObjectHandler = GetObjectHandler; IsReady = true; }); t.Start(); Stopwatch st = Stopwatch.StartNew(); while (!IsReady && st.ElapsedMilliseconds < 10000) { Thread.Sleep(50); } RemoteObjectsClient c = new RemoteObjectsClient(); //TODO: temp get local host c.Connect(SocketHelper.GetDisplayHost(), SocketHelper.GetDisplayPort()); IDisplay calc1 = c.GetObject <IDisplay>("aa1"); int total = calc1.Add(2, 5); Assert.AreEqual(7, total); }
public void AttachDisplay() { //TODO: get return code - based on it set status if running OK NewPayLoad PL = new NewPayLoad(nameof(IDriverDisplay.AttachDisplay)); PL.PaylodType = NewPayLoad.ePaylodType.DriverRequest; //tODO string host = SocketHelper.GetDisplayHost(); int port = SocketHelper.GetDisplayPort(); PL.AddValue(host); PL.AddValue(port); PL.ClosePackage(); SendRequestPayLoad(PL); }