xSocket multiplexed介绍

xsocket源码和socket源码,文档 socket,xscoket技术详解,包括两个实例,服务端客户端相互收发信息,建立监听,建立连接等 立即下载
 xSocket是一个轻量级的基于nio的服务器框架用于开发高性能、可扩展、多线程的服务器。该框架封装了线程处理、异步读/写等方面。 

相关socket介绍请看 
xsocket documentation 

xsocket Multiplexed是xSocket的一个扩展模块,xsocket Multiplexed的定义是支持一个物理TCP连接之上运行的多个逻辑连接。 
说白了其实就是长连接的利用,所谓长连接就是Client方与Server方先建立通讯连接,连接建立后不断开, 然后再进行报文发送和接收。对于点对点的通讯,比较适合。使用xsocket Multiplexed进行持久连接通讯,对业务开发更加友好。 




下面是一个同步客户端的例子: 


Java代码  复制代码  收藏代码
  1. // 建立一个客户端的 multiplexed connection,   
  2. //这个连接里面套了一个NonBlockingConnection,后面所有的逻辑连接都通过这个连接传输数据   
  3. INonBlockingConnection nativeCon = NonBlockingConnection(hostname, 9011);    
  4. IMultiplexedConnection multiplexedCon = new MultiplexedConnection(nativeCon);     
  5.  // 建立一个逻辑连接 pipeline,然后所做的事情就是,向服务端写了一个header,默认实现是写了18个字节。   
  6. //VERSION byte(1) ;  PIPELINE_OPENED byte(1) ; UUID(16)   
  7.  //服务端收到header后就会调用注册handler的onPipelineOpend方法    
  8. String controlPipelineId = multiplexedCon.createPipeline();    
  9. IBlockingPipeline controlPipeline = multiplexedCon.getBlockingPipeline(controlPipelineId);   
  10.   
  11.   
  12. // 在发送数据时,会再向服务端写一个header    
  13. //VERSION byte(1) ;  PIPELINE_DATA byte(1) ; UUID(16)    
  14. //告诉服务端,我要写正文了,服务端会调用注册handler的onPipelineData方法,开始准备接收数据处理业务逻辑    
  15. //在处理过程中建立新的逻辑连接进行处理,多个逻辑连接之间不会有影响    
  16.   
  17. controlPipeline.write("NEW_MESSAGE_PIPELINE\r\n");    
  18. String messagePipelineId = commandPipeline.readStringByDelimiter("\r\n");    
  19. IBlockingPipeline messagePipeline = multiplexedCon.getBlockingPipeline(messagePipelineId);   
  20. messagePipeline.write(messsagepart_1);    
  21. messagePipeline.write(messsagepart_2); ...     
  22. controlPipeline.write("CLOSE_MESSAGE_PIPELINE" + messagePipelineId + "\r\n");    
  23.   
  24. //最后关闭业务连接,向服务端发送一个header    
  25. //VERSION byte(1) ;  PIPELINE_CLOSED byte(1) ; UUID(16)   
  26. //服务端收到后就会调用注册handler的onPipelineClosed方法进行后续清理   
  27. //这个关闭仅仅是逻辑链接的关闭,并非主连接的关闭。   
  28. messagePipeline.close();   
[java]  view plain copy
  1. // 建立一个客户端的 multiplexed connection,  
  2. //这个连接里面套了一个NonBlockingConnection,后面所有的逻辑连接都通过这个连接传输数据  
  3. INonBlockingConnection nativeCon = NonBlockingConnection(hostname, 9011);   
  4. IMultiplexedConnection multiplexedCon = new MultiplexedConnection(nativeCon);    
  5.  // 建立一个逻辑连接 pipeline,然后所做的事情就是,向服务端写了一个header,默认实现是写了18个字节。   
  6. //VERSION byte(1) ;  PIPELINE_OPENED byte(1) ; UUID(16)  
  7.  //服务端收到header后就会调用注册handler的onPipelineOpend方法   
  8. String controlPipelineId = multiplexedCon.createPipeline();   
  9. IBlockingPipeline controlPipeline = multiplexedCon.getBlockingPipeline(controlPipelineId);  
  10.   
  11.   
  12. // 在发送数据时,会再向服务端写一个header   
  13. //VERSION byte(1) ;  PIPELINE_DATA byte(1) ; UUID(16)   
  14. //告诉服务端,我要写正文了,服务端会调用注册handler的onPipelineData方法,开始准备接收数据处理业务逻辑   
  15. //在处理过程中建立新的逻辑连接进行处理,多个逻辑连接之间不会有影响   
  16.   
  17. controlPipeline.write("NEW_MESSAGE_PIPELINE\r\n");   
  18. String messagePipelineId = commandPipeline.readStringByDelimiter("\r\n");   
  19. IBlockingPipeline messagePipeline = multiplexedCon.getBlockingPipeline(messagePipelineId);  
  20. messagePipeline.write(messsagepart_1);   
  21. messagePipeline.write(messsagepart_2); ...    
  22. controlPipeline.write("CLOSE_MESSAGE_PIPELINE" + messagePipelineId + "\r\n");   
  23.   
  24. //最后关闭业务连接,向服务端发送一个header   
  25. //VERSION byte(1) ;  PIPELINE_CLOSED byte(1) ; UUID(16)  
  26. //服务端收到后就会调用注册handler的onPipelineClosed方法进行后续清理  
  27. //这个关闭仅仅是逻辑链接的关闭,并非主连接的关闭。  
  28. messagePipeline.close();   


服务端的处理 

对于一个新的IMultiplexedConnection服务端会调度到线程池执行,而对于IMultiplexedConnection的逻辑链接默认是在IMultiplexedConnection所在的线程中执行的,你也可以将逻辑链接中的业务处理自行调度到线程池中去执行。 



Java代码  复制代码  收藏代码
  1. IServer server = new Server(9011, new MultiplexedProtocolAdapter(new CommandPipelineHandler()));   
  2. ConnectionUtils.start(server);   
  3.     
  4.     
  5. // pipeline data handler which is assigned to each new pipeline   
  6. class CommandPipelineHandler implements IPipelineDataHandler {   
  7.     
  8.     public boolean onData(INonBlockingPipeline pipeline) throws IOException {   
  9.         String cmd = pipeline.readStringByDelimiter("\r\n")   
  10.     
  11.         if (cmd.equals("NEW_MESSAGE_PIPELINE")) {   
  12.             IMultiplexedConnection mplCon = pipeline.getMultiplexedConnection();   
  13.     
  14.             //这里定义了一个新的逻辑连接,并不和其他逻辑连接冲突   
  15.             String msgPipelineId = mplCon.createPipeline();   
  16.             INonBlockingPipeline msgPipeline = mplCon.getNonBlockingPipeline(msgPipelineId);   
  17.     
  18.             // replace the CommandPipelineHandler of the new pipeline   
  19.             // 为新的逻辑连接指派一个handler,   
  20.             // 和当前handler在一个线程中,即使设定@Execution(Execution.MULTITHREADED) 也是没用的   
  21.             msgPipeline.setHandler(new DataHandler());   
  22.             pipeline.write(msgPipelineId + "\r\n");   
  23.   
  24.             //耗时业务处理可以自行进行线程池调度,比如   
  25.             pipeline.getWorkerpool().execute(task..);   
  26.     
  27.                
  28.     
  29.         } ...   
  30.         ...   
  31.     }   
  32. }   
  33.     
  34. // A pipeline handler could also be a ordinary handler like IDataHandler   
  35. class DataHandler implements IDataHandler {   
  36.     
  37.     private FileChannel fc = null;   
  38.     
  39.     DataHandler() {   
  40.         File file = ...   
  41.         fc = new RandomAccessFile(file, "rw").getChannel();   
  42.         ...   
  43.     }   
  44.     
  45.     
  46.     public boolean onData(INonBlockingConnection pipeline) throws IOException {   
  47.         pipeline.transferTo(fc, pipeline.available());   
  48.         ...   
  49.         return true;   
  50.     }   
  51. }  
[java]  view plain copy
  1. IServer server = new Server(9011, new MultiplexedProtocolAdapter(new CommandPipelineHandler()));  
  2. ConnectionUtils.start(server);  
  3.    
  4.    
  5. // pipeline data handler which is assigned to each new pipeline  
  6. class CommandPipelineHandler implements IPipelineDataHandler {  
  7.    
  8.     public boolean onData(INonBlockingPipeline pipeline) throws IOException {  
  9.         String cmd = pipeline.readStringByDelimiter("\r\n")  
  10.    
  11.         if (cmd.equals("NEW_MESSAGE_PIPELINE")) {  
  12.             IMultiplexedConnection mplCon = pipeline.getMultiplexedConnection();  
  13.    
  14.             //这里定义了一个新的逻辑连接,并不和其他逻辑连接冲突  
  15.             String msgPipelineId = mplCon.createPipeline();  
  16.             INonBlockingPipeline msgPipeline = mplCon.getNonBlockingPipeline(msgPipelineId);  
  17.    
  18.             // replace the CommandPipelineHandler of the new pipeline  
  19.             // 为新的逻辑连接指派一个handler,  
  20.             // 和当前handler在一个线程中,即使设定@Execution(Execution.MULTITHREADED) 也是没用的  
  21.             msgPipeline.setHandler(new DataHandler());  
  22.             pipeline.write(msgPipelineId + "\r\n");  
  23.   
  24.             //耗时业务处理可以自行进行线程池调度,比如  
  25.             pipeline.getWorkerpool().execute(task..);  
  26.    
  27.               
  28.    
  29.         } ...  
  30.         ...  
  31.     }  
  32. }  
  33.    
  34. // A pipeline handler could also be a ordinary handler like IDataHandler  
  35. class DataHandler implements IDataHandler {  
  36.    
  37.     private FileChannel fc = null;  
  38.    
  39.     DataHandler() {  
  40.         File file = ...  
  41.         fc = new RandomAccessFile(file, "rw").getChannel();  
  42.         ...  
  43.     }  
  44.    
  45.    
  46.     public boolean onData(INonBlockingConnection pipeline) throws IOException {  
  47.         pipeline.transferTo(fc, pipeline.available());  
  48.         ...  
  49.         return true;  
  50.     }  
  51. }  



Multiplexer的实现 

在Multiplexer可以定义发送header及如何读取数据的的各项细节,参见默认的实现可以了解的更多,基本上一目了然了。 

默认实现是org.xsocket.connection.multiplexed.multiplexer.SimpleMultiplexer 




你可以自定义个Multiplexer: 

Java代码  复制代码  收藏代码
  1. // client-side custom multiplexed handling   
  2. IMultiplexedConnection multiplexedCon = new MultiplexedConnection(nativeCon, new MyMultiplexer());   
  3.     
  4. // server-side custom multiplexed handling   
  5. IHandler adpater = new MultiplexedProtocolAdapter(new CommandPipelineHandler(), new MyMultiplexer()))   
  6. IServer server = new Server(9011, adpater);   
[java]  view plain copy
  1. // client-side custom multiplexed handling  
  2. IMultiplexedConnection multiplexedCon = new MultiplexedConnection(nativeCon, new MyMultiplexer());  
  3.    
  4. // server-side custom multiplexed handling  
  5. IHandler adpater = new MultiplexedProtocolAdapter(new CommandPipelineHandler(), new MyMultiplexer()))  
  6. IServer server = new Server(9011, adpater);   


Java代码  复制代码  收藏代码
  1. class MyMultiplexer implements IMultiplexer {   
  2.     
  3.   
  4.     //打开一个新的逻辑连接,向对端发送一个header   
  5.     public String openPipeline(INonBlockingConnection nbc)    
  6.              throws IOException,    
  7.              ClosedException {   
  8.   
  9.         ... create a unique pipelineId   
  10.         ... create a network packet   
  11.         ... and send it to the peer   
  12.     
  13.         return pipelineId;   
  14.     }   
  15.     
  16.     //关闭逻辑连接,向对端发送一个header   
  17.     public void closePipeline(INonBlockingConnection nbc, String pipelineId)   
  18.              throws IOException,    
  19.              ClosedException {   
  20.   
  21.         ... create a network packet   
  22.         ... and send it to the peer   
  23.     }   
  24.     
  25.     //发送正文的之前执行,想对端发送一个header      
  26.     public void multiplex(INonBlockingConnection nbc, String pipelineId, ByteBuffer[] dataToWrite)   
  27.              throws IOException,    
  28.              ClosedException {   
  29.   
  30.         ... create a network packet based on the pipeline data   
  31.         ... and send it to the peer   
  32.     }   
  33.   
  34.       
  35.     public void multiplex(INonBlockingConnection nbc, String pipelineId, ByteBuffer[] dataToWrite, IWriteCompletionHandler completionHandler)   
  36.              throws IOException,    
  37.              ClosedChannelException {   
  38.   
  39.         ... create a network packet based on the pipeline data   
  40.         ... and send it to the peer   
  41.    }   
  42.   
  43.     
  44.      //这个方法定义数据的接收处理   
  45.     public void demultiplex(INonBlockingConnection nbc, IDemultiplexResultHandler rsltHdl)    
  46.              throws IOException,    
  47.              ClosedException {   
  48.   
  49.         ... read the network packet   
  50.         ... notify the specific pipeline message   
  51.   
  52.             //默认实现是:   
  53.            byte dataType = nbc.readByte();   
  54.            ...   
  55.         switch (dataType) {   
  56.             case PIPELINE_DATA:...rsltHdl.onPipelineData(pipelineId, data);   
  57.             case PIPELINE_OPENED:...rsltHdl.onPipelineOpend(pipelineId, data);   
  58.             case PIPELINE_CLOSED:...rsltHdl.onPipelineClosed(pipelineId, data);   
  59.                         default:...   
  60.                 }   
  61.            ...   
  62.               
  63.             
  64.     }   
  65. }  
[java]  view plain copy
  1. class MyMultiplexer implements IMultiplexer {  
  2.    
  3.   
  4.     //打开一个新的逻辑连接,向对端发送一个header  
  5.     public String openPipeline(INonBlockingConnection nbc)   
  6.              throws IOException,   
  7.              ClosedException {  
  8.   
  9.         ... create a unique pipelineId  
  10.         ... create a network packet  
  11.         ... and send it to the peer  
  12.    
  13.         return pipelineId;  
  14.     }  
  15.    
  16.     //关闭逻辑连接,向对端发送一个header  
  17.     public void closePipeline(INonBlockingConnection nbc, String pipelineId)  
  18.              throws IOException,   
  19.              ClosedException {  
  20.   
  21.         ... create a network packet  
  22.         ... and send it to the peer  
  23.     }  
  24.    
  25.     //发送正文的之前执行,想对端发送一个header     
  26.     public void multiplex(INonBlockingConnection nbc, String pipelineId, ByteBuffer[] dataToWrite)  
  27.              throws IOException,   
  28.              ClosedException {  
  29.   
  30.         ... create a network packet based on the pipeline data  
  31.         ... and send it to the peer  
  32.     }  
  33.   
  34.      
  35.     public void multiplex(INonBlockingConnection nbc, String pipelineId, ByteBuffer[] dataToWrite, IWriteCompletionHandler completionHandler)  
  36.              throws IOException,   
  37.              ClosedChannelException {  
  38.   
  39.         ... create a network packet based on the pipeline data  
  40.         ... and send it to the peer  
  41.    }  
  42.   
  43.    
  44.      //这个方法定义数据的接收处理  
  45.     public void demultiplex(INonBlockingConnection nbc, IDemultiplexResultHandler rsltHdl)   
  46.              throws IOException,   
  47.              ClosedException {  
  48.   
  49.         ... read the network packet  
  50.         ... notify the specific pipeline message  
  51.   
  52.             //默认实现是:  
  53.            byte dataType = nbc.readByte();  
  54.            ...  
  55.         switch (dataType) {  
  56.             case PIPELINE_DATA:...rsltHdl.onPipelineData(pipelineId, data);  
  57.             case PIPELINE_OPENED:...rsltHdl.onPipelineOpend(pipelineId, data);  
  58.             case PIPELINE_CLOSED:...rsltHdl.onPipelineClosed(pipelineId, data);  
  59.                         default:...  
  60.                 }  
  61.            ...  
  62.              
  63.            
  64.     }  
  65. }  


总的来说这个api还是非常轻巧实用的。
xSocket_v2.5.5-api.chm 一个使java socket编程更简化的工具包API说明文档 立即下载

相关推荐

轻量级JAVA scoket 服务器XSOCKET

轻量级JAVA scoket 服务器XSOCKET

xSocket 通讯框架 demo

xSocket是一个轻量级的基于nio的服务器框架用于开发高性能、可扩展、多线程的服务器。该框架封装了线程处理、异步读/写等方面。  http://www.xsocket.org/ API:http://xsocket.sourceforge.net/core/apidocs/2_1/index.htmlhttp://xsocket.sourceforge.net/core/apidocs

风行天下 1万+

java源码:NIO网络框架 xSocket.rar

java源码:NIO网络框架 xSocket.rar

计算机网络必修课:运输层了解一下!

文章目录运输层【1】运输层基本概念【1.1】端口【1.2】运输层和网络层协议区别 运输层 【1】运输层基本概念 用户应用层的下面就是运输层了,运输层是作为通信部分的最高层,也是用户功能中的最低层。只有网络边缘部分的主机协议栈有运输层,网络核心部分的主机一般只用到了下面的三层(物理层、数据链路层、网络层) 在一台主机中,经常有多个应用进程分别与另一个主机中的多个应用进程通信 运输层的重要功能: 复用(multiplex)、分用(demultiplex) (1)复用针对发送方 (2)分用针对接收方 【

小杨的博客 935

基于XSocket、mdb、zq构建端到端高性能可视化量化分析交易系统

基于XSocket、mdb、zq构建端到端高性能可视化量化分析交易系统(包含服务器、客户端,支持ExcelVBAPythonCC++开发).zip

微分中值定理

文章目录证明根的存在性证明不等式微分中值定理有关的证明题解题方法题目1题目2题目3题目4题目5题目6题目7题目8(难) 微分中值定理:把函数改变量与一点的导数值联系起来 中值定理意义:将函数与导数联系起来 证明根的存在性 证明根的存在性:零点定理和罗尔定理 由于无法说明两端点异号,所以想罗尔定理 构造一个辅助函数,这个辅助函数的导数为要证的方程 这个辅助函数在两端点值相等,说明辅助函数的导数在0到1内存在0点。 这也就是为什么要构造一个导数为要证明的方程的原因 证明不等式 题目中出现了两点函

sparky的博客 4907

Xsocket

xSocket是一个易于使用的基于NIO库来构建高性能,可扩展的网络应用。 它支持写入以及服务器端的应用,以直观的方式客户端应用程序。 检测问题,如低水平NIO选择编程,连接池管理,连接超时被封装的xSocket。 pom.xml <dependency> <groupId>org.xsocket</groupId> <artif...

weixin_43355440的博客 1820

学习 Bootstrap 5 之 Tables

学习 Bootstrap 5 之 表格表格 (Tables)1. 创建表格(1). 使用原生的表格标签(2). 使用Bootstrap 5 的提供的表格标签类(3). 原生与Bootstrap创建出来的表格的对比2. 表格样式(1). 表格样式的效果(2). 表格样式的使用1). 用于 <table> 标签2). 用于 <thead> <tbody> <tfoot> 标签 表格 (Tables) 1. 创建表格 (1). 使用原生的表格标签 <tabl

qq_37354060的博客 2130

XSocket的学习和总结

xSocket是一个易于使用的基于NIO库来构建高性能,可扩展的网络应用。它支持写入以及服务器端的应用,以直观的方式客户端应用程序。检测问题,如低水平NIO选择编程,连接池管理,连接超时被封装的xSocket。 我从它的官网上面下载了两个JAR一个是其核心JAR包xSocket (core) 下载地址是:http://sourceforge.net/projects/xs...

weixin_30367543的博客 331

基于STM32环境温湿度监测系统设计

基于STM32环境温湿度监测系统设计1. 实验目的2. 任务和要求3. proteus仿真图4. 实验代码 1. 实验目的 (1) 掌握使用 KEIL MDK5 进行软件开发的具体流程; (2) 掌握硬件电路的设计方法; (3) 掌握 STM32 微控制器的程序设计及代码编写方法。 2. 任务和要求 (1)在 STM32F103 平台下,通过温度传感器 DS18B20 和湿度传感器 DHT11 实现环境温湿度信息的采集; (2)将温度传感器和湿度传感器所采集的数据在 LCD 液晶屏幕上显示出来,超

唯一的博客 2万+

【汽车ECU电控数据管理篇】A2L文件在ECU标定中的关键作用与实战解析

本文深入解析A2L文件在汽车ECU标定中的关键作用,详细介绍了其作为'数据字典'的核心功能与实战应用。通过剖析A2L文件的结构、关键标签及常见问题,帮助工程师高效管理电控数据,提升ECU标定效率与准确性。文章特别强调了ASAP2标准下的A2L文件在汽车电控系统中的重要性。

a3b4c5的博客 789

分析JAVA源码socket_xsocket源码解读

关于xsocket可见于 我的另外一篇文章http://www.blogjava.net/freeman1984/archive/2011/04/25/302706.html,或者查看官网http://xsocket.org/当然阅读xsocket需要一些线程,nio,niosocket,和java.util.concurrent(锁,线程池等)包的一些知识。要不读起来很费劲,建议先去了解下这些知...

weixin_32306175的博客 412

从源码编译CesiumForUnreal

从源码编译CesiumForUnreal插件

专注GIS开发 5644

xSocket 教程

Connection-Oriented网络应用教程 这是一个使用xSocket2.0编写connection-oriented网络应用的初学者教程。 如果您需要更多的帮助,不要犹豫,使用 xSocket的支持论坛 。xsocket-develop@lists.sourceforge.net 核心功能 主要的抽象,以支持面向流的沟通是 连接 。 读取数据,并书面使用 IBlocki...

胖头鱼 1926

【Zephyr存储专题】09_LittleFs文件系统操作

本文档旨在为开发者介绍Zephyr下Littlef's文件系统相关配置使用指南

zero的博客 3246

HyperLynx中层叠设计实例

这两种方式有点区别,前一种方式只是增加层,需要自行修改层的类型,后一种方式可以选定为某一种类型,如果是增加信号层,软件会默认同时增加一层介质层。层叠已经有8层,按照示例的层叠有4个信号层、3个地平面层和1个电源平面层,对照进行层名称(LayerName)、介质类型(Type)及用途(Usage)设置。在这列中,有的是白色,有的是淡蓝色。白色的说明可以修改,如第一行是介质,通常在最外层的介质有两个用途,阻焊层和介质,单击该行会出现一个下拉菜单,选择SolderMask,即为阻焊层。...

小幽余生不加糖 5879

xsocket基础学习一

1、这个开源的框架只需要有一个J2SE5.0就行了不需要其他的JAR支持。 我从它的官网上面下载了两个JAR一个是其核心JAR包xSocket (core) 下载地址是:http://sourceforge.net/projects/xsocket/files/xsocket%202.x/2.7.2/xSocket-2.7.2.jar/download 另外一个JAR包是:xSock...

wf235的博客 317

交货单冲销发货过账的正确姿势:用 VL09 与 ABAP 批量反冲 Goods Issue

摘要 本文详细解析了SAP系统中VL09事务码的技术实现与业务应用。VL09用于反冲发货的货物移动,通过标准冲销路径(移动类型602冲销601)确保单据链路一致、状态机正确回退和业务规则生效。文章对比了经典VL09与Fiori应用在不同SAP产品形态中的位置,并针对STO场景提供了ME23N验证方法。核心内容包括WS_REVERSE_GOODS_ISSUE函数模块的调用要点、必须COMMIT的原因(SAP LUW机制),以及处理Handling Unit等限制条件的注意事项。最后给出了将VL09工程化的项目

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 595

基于XSocket框架的socket编程技艺(同步通信)

基于XSocket框架的socket编程技艺(同步通信) www.MyException.Cn  网友分享于:2015-08-26  浏览:76次 基于XSocket框架的socket编程技巧(同步通信) 基于XSocket框架的socket编程技巧(同步通信) 最近在做socket通信编程,现总结如下,关于XSocket的大话就不再多说了,google一下一大片。 一、 

H思xian------博客 1182

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

手把手教你写 Socket 长连接

本文由玉刚说写作平台[1]提供写作赞助 原作者:水晶虾饺[2] 版权声明:本文版权归微信公众号 玉刚说 所有,未经许可,不得以任何形式转载 本篇我们先简单了解一下 TCP/IP,然后通过实现一个 echo 服务器来学习 Java 的 Socket API。最后我们聊聊偏高级一点点的 socket 长连接和协议设计。 TCP/IP 协议简介 IP 首先我们看 IP(Internet Protoc...

weixin_34326179的博客 2989

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

常见NIO开源框架(MINA、xSocket)学习 (转自javaeye博客)

http://unbounder.iteye.com/blog/481396 http://unbounder.iteye.com/blog/481668     基于io包的阻塞式socket通信代码简单,在连接数很少的情况下是一个不错的选择。不过实际应用中一个socket服务器采用传统的阻塞式socket方式通信可能会是一场灾难,一路socket同时进行读写操作可能就需要两条线程,如果...

青岛金鑫-java技术攻略 嫁给我是你一生的赌注,我怎么忍心让你输? 329

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

使用xsocket框架实现的Android即时通讯软件

通过Xsocket实现的Android微信,并不是特别完善,可以在上面进行修改,界面仿照微信进行开发的,Xstream实现XML的传输,可以改成JSON,包括系统的登录,添加好友,聊天,朋友圈啊等功能。使用Activity、intent、SharedPreferences、ContentProvider,BroadcastReceiver、Application、dialog等. 系统从总体

kai46385076的专栏 2875

XSocket-Modern C++跨平台网络库

新XSocket已发布在github上:https://github.com/7thTool/XSocket.git XSocket是一个简单的Socket跨平台可伸缩库,你可以把它编译成动态库、静态库、或者直接包含源文件到你的工程里。 鉴于网络上充斥着各类Socket库,好坏不一,难言好用,本人根据多年从业经验和对设计的精益求精的态度,独辟蹊径,使用泛型技术来实现XSocket-简单的...

章志强的专栏 4823
上一篇: XSocket的学习和总结
下一篇: NIO
zljjava
博客等级 码龄15年 155粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值