Exemplo n.º 1
0
        public FastRpcClient(IPAddress ip, int port)
        {
            ServerIP   = ip;
            ServerPort = port;

            _client = (SimpleRpcClient)SimpleRpcClientPoolRoot.Depool(ip, port);
        }
Exemplo n.º 2
0
        public FastRpcClient(IPAddress ip, int port)
        {
            ServerIP   = ip;
            ServerPort = port;

            _client = (SimpleRpcClient)SimpleRpcClientFactory.Create(ip, port);
        }
        private void TakeBackInternal(SimpleRpcClient rpcClient)
        {
            if (_clientQueue.Count >= NetworkSettings.ClientCacheSize)
            {
                try
                {
                    rpcClient.Close();
                }
                catch
                {
                }
                return;
            }

            _clientQueue.Enqueue(rpcClient);
        }
        public static bool ReturnItem(SimpleRpcClient rpcClient)
        {
            var factory = GetOrAddPool(rpcClient.ServerIP, rpcClient.ServerPort);

            return(factory.Return(rpcClient));
        }