/// <exception cref="System.IO.IOException"/>
 private Version2Client(TestRPCCompatibility _enclosing)
 {
     this._enclosing = _enclosing;
     this.serverInfo = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol2>(TestRPCCompatibility.TestProtocol2
                                                                                 .versionID, TestRPCCompatibility.addr, TestRPCCompatibility.conf);
     this.proxy2 = this.serverInfo.GetProxy();
 }
 public virtual void TearDown()
 {
     if (proxy != null)
     {
         RPC.StopProxy(proxy.GetProxy());
         proxy = null;
     }
     if (server != null)
     {
         server.Stop();
         server = null;
     }
 }
 public virtual void TestVersion0ClientVersion1Server()
 {
     // old client vs new server
     // create a server with two handlers
     TestRPCCompatibility.TestImpl1 impl = new TestRPCCompatibility.TestImpl1();
     server = new RPC.Builder(conf).SetProtocol(typeof(TestRPCCompatibility.TestProtocol1
                                                       )).SetInstance(impl).SetBindAddress(Address).SetPort(0).SetNumHandlers(2).SetVerbose
                  (false).Build();
     server.AddProtocol(RPC.RpcKind.RpcWritable, typeof(TestRPCCompatibility.TestProtocol0
                                                        ), impl);
     server.Start();
     addr  = NetUtils.GetConnectAddress(server);
     proxy = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol0>(TestRPCCompatibility.TestProtocol0
                                                                       .versionID, addr, conf);
     TestRPCCompatibility.TestProtocol0 proxy0 = (TestRPCCompatibility.TestProtocol0)proxy
                                                 .GetProxy();
     proxy0.Ping();
 }
 public virtual void TestVersion1ClientVersion0Server()
 {
     // old client vs new server
     // create a server with two handlers
     server = new RPC.Builder(conf).SetProtocol(typeof(TestRPCCompatibility.TestProtocol0
                                                       )).SetInstance(new TestRPCCompatibility.TestImpl0()).SetBindAddress(Address).SetPort
                  (0).SetNumHandlers(2).SetVerbose(false).Build();
     server.Start();
     addr  = NetUtils.GetConnectAddress(server);
     proxy = RPC.GetProtocolProxy <TestRPCCompatibility.TestProtocol1>(TestRPCCompatibility.TestProtocol1
                                                                       .versionID, addr, conf);
     TestRPCCompatibility.TestProtocol1 proxy1 = (TestRPCCompatibility.TestProtocol1)proxy
                                                 .GetProxy();
     proxy1.Ping();
     try
     {
         proxy1.Echo("hello");
         NUnit.Framework.Assert.Fail("Echo should fail");
     }
     catch (IOException)
     {
     }
 }