private DataContractProxy GetContract(TypeProxy type) { if (type.IsClass || type.IsValueType || type.IsEnum) { DataContractProxy contract = null; if (!_typeContracts.TryGetValue(type, out contract)) { contract = type.GetDataContract(); _typeContracts.Add(type, contract); } return(contract); } return(null); }
static void Main(string[] args) { //var client = new ClientConnectionBase("127.0.0.1", 5000, 256); //client.Connect(); ////========== //var message = "loging|123456"; //client.Send(message); //Console.Read(); //var proxy = TcpProxy.CreateProxy<IDataContract>(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5000)); //var s = proxy.AddMoney(1, 2); //Console.WriteLine(proxy.AddMoney(1, 2)); //Console.WriteLine(proxy.AddMoney(1, 2)); //Console.WriteLine(proxy.AddMoney(1, 2)); //Console.WriteLine(s); var p = new DataContractProxy(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5000)); var s = p.AddMoney(1, 2); Console.WriteLine(s); Console.Read(); }