use of com.code.server.rpc.idl.Order in project summer by foxsugar.
the class RpcManager method testGame.
private static void testGame(int count) {
for (int i = 0; i < count; i++) {
try {
synchronized (rpcLock) {
TTransport adminTransport = TransportManager.getTransport("192.168.1.132", 9090);
GameRPC.Client client = GameRpcClient.getAClient(adminTransport);
// client.getUserInfo(1);
Order order = new Order();
order.setUserId(1);
order.setNum(1);
order.setType(1);
client.charge(order);
adminTransport.close();
}
} catch (Exception e) {
}
}
}
use of com.code.server.rpc.idl.Order in project summer by foxsugar.
the class RpcManager method charge.
private static void charge(String ip, int id, int num) throws TException {
TTransport adminTransport = new TFramedTransport(new TSocket(ip, 9090));
adminTransport.open();
// TTransport adminTransport = TransportManager.getTransport(ip, 9090);
GameRPC.Client client = GameRpcClient.getAClient(adminTransport);
// client.getUserInfo(1);
Order order = new Order();
order.setUserId(id);
order.setNum(num);
order.setType(1);
int rtn = client.charge(order);
adminTransport.close();
// 充值成功
if (rtn == 0) {
// todo 插入一条充值记录
}
}
Aggregations