当前位置: 首页 > news >正文

国外有什么网站做游戏吗百度推广工具有哪些

国外有什么网站做游戏吗,百度推广工具有哪些,做网站的软件page,定制开发电商网站建设多少钱当我们使用Thrift 通信的时候,服务端有时候需要注册多个类,去实现通信,这时候我们就不能再使用单一Processor的方式,就要使用多个Processor,那么如何去实现呢? 多个Process 服务端 public static void m…

当我们使用Thrift 通信的时候,服务端有时候需要注册多个类,去实现通信,这时候我们就不能再使用单一Processor的方式,就要使用多个Processor,那么如何去实现呢?

多个Process

服务端

public static void main(String[] args) {try {AImpl aService = new AImpl();BImpl bService=new BImpl();TMultiplexedProcessor multiplexedProcessor = new TMultiplexedProcessor();AService.Processor<AImpl> aProcessor = new AService.Processor<>(aService);multiplexedProcessor.registerProcessor("aService", aProcessor);BService.Processor<BImpl> bProcessor = new BService.Processor<>(bService);multiplexedProcessor.registerProcessor("bService", bProcessor);TServerSocket serverTransport = new TServerSocket(80000);TThreadPoolServer.Args serverArgs = new TThreadPoolServer.Args(serverTransport);serverArgs.processor(multiplexedProcessor);TServer server = new TThreadPoolServer(serverArgs);System.out.println("Starting the multi-processor server...");server.serve();} catch (Exception e) {e.printStackTrace();System.out.println(e.getMessage());}}

客户端

public static void main(String[] args) throws TException {TTransport transport = new TSocket("localhost", 80000);transport.open();// AServiceTMultiplexedProtocol multiplexedProtocol = new TMultiplexedProtocol(new TBinaryProtocol(transport), "aService");AService.Client aClient = new AService.Client(multiplexedProtocol);aClient.method();System.out.println("Calling AService method...");// BServicemultiplexedProtocol = new TMultiplexedProtocol(new TBinaryProtocol(transport), "bService");BService.Client bClient = new BService.Client(multiplexedProtocol);BClient.method();System.out.println("Calling SystemLogService method...");transport.close();}

这个Demo中,我们要用到两个接口类,那么,A和B,使用TMultiplexedProcessor 去注册两个Service,启动服务。

单个Process

服务端

            AImpl aService = new AImpl();TServerSocket serverSocket = new TServerSocket(90000);AService.Processor<AImpl> aProcessor= new AService.Processor<>(aService);TThreadPoolServer.Args serverArg = new TThreadPoolServer.Args(serverSocket);serverArg.processor(aProcessor);TThreadPoolServer server = new TThreadPoolServer(serverArg);server.serve();

客户端

 TTransport transport = new TSocket("localhost", 90000);transport.open();TBinaryProtocol protocol = new TBinaryProtocol(transport);AService.Client aClient = new AService.Client(protocol);aclient.method();

附单个process的方式。

http://www.yidumall.com/news/18949.html

相关文章:

  • 有哪些线上做酒店的网站百度账号登录官网
  • 网站开发顺序免费云服务器
  • 网站做游戏活动查询网址域名ip地址
  • 做网站怎么安装数据库北京seo运营
  • 做视频网站靠什么赚钱吗seo什么职位
  • 汕头网站制作找哪家优化大师软件下载
  • 免费无版权图片网站淘宝seo优化是什么意思
  • 爱疯卷网站怎么做软文网站模板
  • 提供网站建设服务的网站价格网站访问量统计工具
  • 大学php动态网站开发试卷搜索网站有哪几个
  • 如何建单位网站买卖链接网站
  • 深圳网站建设html5公众号怎么推广
  • 有没有专门做av中文的网站百度账号登陆入口
  • 国内网络科技网站建设5188关键词挖掘工具
  • 潍坊网站设计网络推广费用预算表
  • 站长seo综合查询网站优化排名软件网
  • 网站开发有哪些新技术谷歌浏览器下载视频
  • wordpress 双陈快速排序优化
  • 深圳品牌营销网站建设软文代发平台
  • 网站建设论文的结论苏州关键词优化搜索排名
  • 沈阳哪有做网站的计算机培训短期速成班
  • 深圳app客户端做网站首页关键词排名
  • 搭建的网站403百度推广的步骤
  • 为什么网站有不同的扩展名磁力最好用的搜索引擎
  • 品牌展示榜ui做的好的网站域名注册商
  • wordpress页面链接跳转优化教程
  • 可以做动效的网站seo自媒体运营技巧
  • 做图兼职网站有哪些中国免费广告网
  • 德国设计网站百度今日数据
  • 河北住房和城乡建设厅网站卡市场推广计划书