Exemple #1
0
        public void TestTcpRemoting()
        {
            TcpServerChannel serverChannel = GetServerChannel("TcpRemotingTest", 9090);
            string           uri           = serverChannel.GetChannelUri();

            Assert.IsNotNull(uri, "Server channel URI is null");

            TcpClientChannel clientChannel = GetClientChannel("TcpRemotingTest", uri);

            RemoteObject remoteObject = new RemoteObject();

            Assert.IsTrue(remoteObject.ReturnOne() == 1, "Invoking RemoteObject.ReturnOne() failed");
        }
        void MultiClientStart()
        {
            int rv = 0;

            // the prupose of this is just to block until all clients have been created
            lock (mutex) {
                rv++;
            }

            RemoteObject remObj = new RemoteObject();

            rv = remObj.Increment();

            // make sure the value returned hasn't been returned to another thread as well
            lock (retvals) {
                Assert.IsTrue(!retvals[rv], "RemoteObject.Increment() has already returned " + rv);
                retvals[rv] = true;
            }
        }
Exemple #3
0
		public void TestTcpRemoting ()
		{
			TcpServerChannel serverChannel = GetServerChannel ("TcpRemotingTest", 9090);
			string uri = serverChannel.GetChannelUri ();
			
			Assert.IsNotNull (uri, "Server channel URI is null");
			
			TcpClientChannel clientChannel = GetClientChannel ("TcpRemotingTest", uri);
			
			RemoteObject remoteObject = new RemoteObject (); 
			
			Assert.IsTrue (remoteObject.ReturnOne () == 1, "Invoking RemoteObject.ReturnOne() failed");
		}
 public override void ProcessContextData()
 {
     RemoteObject.ProcessContextData();
 }
		void MultiClientStart ()
		{
			int rv = 0;
			
			// the prupose of this is just to block until all clients have been created
			lock (mutex) {
				rv++;
			}
			
			RemoteObject remObj = new RemoteObject ();
			
			rv = remObj.Increment ();
			
			// make sure the value returned hasn't been returned to another thread as well
			lock (retvals) {
				Assert.IsTrue (!retvals[rv], "RemoteObject.Increment() has already returned " + rv);
				retvals[rv] = true;
			}
		}
 public override Complex ComplexParamsInOut(ref ArrayList a, out Complex b, [In, Out] byte[] bytes, [In, Out] StringBuilder sb, string c)
 {
     return(RemoteObject.ComplexParamsInOut(ref a, out b, bytes, sb, c));
 }
 public override Complex ComplexParams(ArrayList a, Complex b, string c)
 {
     return(RemoteObject.ComplexParams(a, b, c));
 }
 public override string PrimitiveParamsInOut(ref int a1, out int a2, ref float b1, out float b2, int filler, ref char c1, out char c2, ref string d1, out string d2)
 {
     return(RemoteObject.PrimitiveParamsInOut(ref a1, out a2, ref b1, out b2, filler, ref c1, out c2, ref d1, out d2));
 }
 public override string PrimitiveParams(int a, uint b, char c, string d)
 {
     return(RemoteObject.PrimitiveParams(a, b, c, d));
 }
 public override int Simple()
 {
     return(RemoteObject.Simple());
 }