- 浏览: 950198 次
文章分类
- 全部博客 (428)
- Hadoop (2)
- HBase (1)
- ELK (1)
- ActiveMQ (13)
- Kafka (5)
- Redis (14)
- Dubbo (1)
- Memcached (5)
- Netty (56)
- Mina (34)
- NIO (51)
- JUC (53)
- Spring (13)
- Mybatis (17)
- MySQL (21)
- JDBC (12)
- C3P0 (5)
- Tomcat (13)
- SLF4J-log4j (9)
- P6Spy (4)
- Quartz (12)
- Zabbix (7)
- JAVA (9)
- Linux (15)
- HTML (9)
- Lucene (0)
- JS (2)
- WebService (1)
- Maven (4)
- Oracle&MSSQL (14)
- iText (11)
- Development Tools (8)
- UTILS (4)
- LIFE (8)
最新评论
-
Donald_Draper:
Donald_Draper 写道刘落落cici 写道能给我发一 ...
DatagramChannelImpl 解析三(多播) -
Donald_Draper:
刘落落cici 写道能给我发一份这个类的源码吗Datagram ...
DatagramChannelImpl 解析三(多播) -
lyfyouyun:
请问楼主,执行消息发送的时候,报错:Transport sch ...
ActiveMQ连接工厂、连接详解 -
ezlhq:
关于 PollArrayWrapper 状态含义猜测:参考 S ...
WindowsSelectorImpl解析一(FdMap,PollArrayWrapper) -
flyfeifei66:
打算使用xmemcache作为memcache的客户端,由于x ...
Memcached分布式客户端(Xmemcached)
MINA TCP简单通信实例:http://donald-draper.iteye.com/blog/2375297
MINA 编解码器实例:http://donald-draper.iteye.com/blog/2375317
MINA 多路分离解码器实例:http://donald-draper.iteye.com/blog/2375324
Mina Socket会话配置:http://donald-draper.iteye.com/blog/2375529
Mina 过滤链默认构建器:http://donald-draper.iteye.com/blog/2375985
Mina 过滤器定义:http://donald-draper.iteye.com/blog/2376161
Mina 日志过滤器与引用计数过滤器:http://donald-draper.iteye.com/blog/2376226
Mina 过滤链抽象实现:http://donald-draper.iteye.com/blog/2376335
Mina Socket与报文过滤链:http://donald-draper.iteye.com/blog/2376440
引言:
上面几篇文章我们简单看了一下Socket会话配置,过滤器及过滤链;在TCP简单通信实例这篇文章中,有这么一段代码:
//配置过滤器
前面我们看过日志过滤器,今天我们来看一下协议编解码过滤器ProtocolCodecFilter。
//属性key
在往下看之前,我们先来看一下协议编解码工厂ProtocolCodecFactory
从上可以看出,协议编解码工厂ProtocolCodecFactory提供协议编码器ProtocolEncoder和解码器ProtocolDecoder;编码器将消息对象编码成二进制或协议数据,解码器将二进制或协议数据解码成消息对象。
再来看编码器与解码器的定义,先来看编码器:
//ProtocolEncoderAdapter
再来看协议编码输出ProtocolEncoderOutput
来看一下ProtocolEncoderOutput的简单实现
从上面可以看出编码器ProtocolEncoder主要有两个方法,encode和dispose;
encode用于,编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode
方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write方法将编码后的消息放在ByteBuffer;dispose方法释放编码器资源。ProtocolEncoderAdapter为编码器抽象实现,默认实现了dispose,不做任何事情,对于不需要释放资源的编码器继承ProtocolEncoderAdapter。ProtocolEncoderOutput主要的工作是将协议编码器编码后的
字节buffer,缓存起来,等待flush方法调用时,则将数据发送出去。SimpleProtocolEncoderOutput为ProtocolEncoderOutput的简单实现内部有一个buffer队列bufferQueue(Queue),用于存放write(ByteBuffer)方法,传入的字节buffer;mergeAll方法为合并buffer队列的所有buffer数据到一个buffer;flush方法为发送buffer队列中的所有buffer,实际发送工作委托给doFlush方法待子类实现。
来看协议编解码过滤器ProtocolCodecFilter的ProtocolEncoderOutput的内部实现:
ProtocolEncoderOutputImpl的doFlush,首先将会话包装成DefaultWriteFuture,
将会话,写请求信息传递给NextFilter
//ProtocolCodecFilter
这一篇,我们先看到这,自此我们了协议编解码过滤器的内部协议编解码工厂ProtocolCodecFactory,及内部的ProtocolEncoderOutputImpl,先来总结一下,至于协议编解码工厂在协议编解码过滤器ProtocolCodecFilter中的作用我们在后面的文章再说。
总结:
协议编解码过滤器ProtocolCodecFilter关联一个协议编解码工厂ProtocolCodecFactory,协议编解码工厂提供协议编码器ProtocolEncoder和解码器ProtocolDecoder;编码器将消息对象编码成二进制或协议数据,解码器将二进制或协议数据解码成消息对象。编码器ProtocolEncoder主要有两个方法,encode和dispose;encode用于,编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write方法将编码后的消息放在ByteBuffer;dispose方法释放编码器资源。ProtocolEncoderAdapter为编码器抽象实现,默认实现了dispose,不做任何事情,对于不需要释放资源的编码器继承ProtocolEncoderAdapter。ProtocolEncoderOutput主要的工作是将协议编码器编码后的字节buffer,缓存起来,等待flush方法调用时,则将数据发送出去。SimpleProtocolEncoderOutput为ProtocolEncoderOutput的简单实现内部有一个buffer队列bufferQueue(Queue),用于存放write(ByteBuffer)方法,传入的字节buffer;
mergeAll方法为合并buffer队列的所有buffer数据到一个buffer;flush方法为发送buffer队列中的所有buffer,实际发送工作委托给doFlush方法待子类实现。ProtocolEncoderOutputImpl为协议编解码过滤器的内部类,ProtocolEncoderOutputImpl的doFlush,首先将会话包装成DefaultWriteFuture,将会话,写请求信息传递给NextFilter。
附:
DefaultIoFuture:
MINA 编解码器实例:http://donald-draper.iteye.com/blog/2375317
MINA 多路分离解码器实例:http://donald-draper.iteye.com/blog/2375324
Mina Socket会话配置:http://donald-draper.iteye.com/blog/2375529
Mina 过滤链默认构建器:http://donald-draper.iteye.com/blog/2375985
Mina 过滤器定义:http://donald-draper.iteye.com/blog/2376161
Mina 日志过滤器与引用计数过滤器:http://donald-draper.iteye.com/blog/2376226
Mina 过滤链抽象实现:http://donald-draper.iteye.com/blog/2376335
Mina Socket与报文过滤链:http://donald-draper.iteye.com/blog/2376440
引言:
上面几篇文章我们简单看了一下Socket会话配置,过滤器及过滤链;在TCP简单通信实例这篇文章中,有这么一段代码:
//配置过滤器
DefaultIoFilterChainBuilder defaultIoFilterChainBuilder = acceptor.getFilterChain(); LoggingFilter loggingFilter = new LoggingFilter(); defaultIoFilterChainBuilder.addLast("loggingFilter", loggingFilter); TextLineCodecFactory textLineCodecFactory = new TextLineCodecFactory(charset,LineDelimiter.WINDOWS.getValue(), LineDelimiter.WINDOWS.getValue()); ProtocolCodecFilter protocolCodecFilter = new ProtocolCodecFilter(textLineCodecFactory); defaultIoFilterChainBuilder.addLast("protocolCodecFilter",protocolCodecFilter);
前面我们看过日志过滤器,今天我们来看一下协议编解码过滤器ProtocolCodecFilter。
/** * An {@link IoFilter} which translates binary or protocol specific data into * message object and vice versa using {@link ProtocolCodecFactory}, * {@link ProtocolEncoder}, or {@link ProtocolDecoder}. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public class ProtocolCodecFilter extends IoFilterAdapter { private static final Logger LOGGER = LoggerFactory.getLogger(org/apache/mina/filter/codec/ProtocolCodecFilter); private static final Class EMPTY_PARAMS[] = new Class[0]; private static final IoBuffer EMPTY_BUFFER = IoBuffer.wrap(new byte[0]); //编码器属性key private static final AttributeKey ENCODER = new AttributeKey(org/apache/mina/filter/codec/ProtocolCodecFilter, "encoder"); //编码器输出属性key private static final AttributeKey ENCODER_OUT = new AttributeKey(org/apache/mina/filter/codec/ProtocolCodecFilter, "encoderOut"); //解码器属性key private static final AttributeKey DECODER = new AttributeKey(org/apache/mina/filter/codec/ProtocolCodecFilter, "decoder"); //解码器输出属性key private static final AttributeKey DECODER_OUT = new AttributeKey(org/apache/mina/filter/codec/ProtocolCodecFilter, "decoderOut"); private final ProtocolCodecFactory factory;//编解码器工厂协议 }
//属性key
public final class AttributeKey implements Serializable { private static final long serialVersionUID = -583377473376683096L; private final String name; public AttributeKey(Class source, String name) { this.name = (new StringBuilder()).append(source.getName()).append('.').append(name).append('@').append(Integer.toHexString(hashCode())).toString(); } public String toString() { return name; } public int hashCode() { int h = 629 + (name != null ? name.hashCode() : 0); return h; } public boolean equals(Object obj) { if(this == obj) return true; if(!(obj instanceof AttributeKey)) { return false; } else { AttributeKey other = (AttributeKey)obj; return name.equals(other.name); } } }
在往下看之前,我们先来看一下协议编解码工厂ProtocolCodecFactory
/** * Provides {@link ProtocolEncoder} and {@link ProtocolDecoder} which translates * binary or protocol specific data into message object and vice versa. * <p>协议编解码工厂ProtocolCodecFactory提供协议编码器和解码器,解码器二进制数据或 协议数据到消息对象;编码器反之。 * Please refer to * [url=../../../../../xref-examples/org/apache/mina/examples/reverser/ReverseProtocolProvider.html]<code>ReverserProtocolProvider</code>[/url] * example. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public interface ProtocolCodecFactory { /** * Returns a new (or reusable) instance of {@link ProtocolEncoder} which * encodes message objects into binary or protocol-specific data. 返回一个编码器实例,用于将消息对象编码成二进制或协议数据 */ ProtocolEncoder getEncoder() throws Exception; /** * Returns a new (or reusable) instance of {@link ProtocolDecoder} which * decodes binary or protocol-specific data into message objects. 返回一个解码器实例,用于将二进制或协议数据解码成消息对象 */ ProtocolDecoder getDecoder() throws Exception; }
从上可以看出,协议编解码工厂ProtocolCodecFactory提供协议编码器ProtocolEncoder和解码器ProtocolDecoder;编码器将消息对象编码成二进制或协议数据,解码器将二进制或协议数据解码成消息对象。
再来看编码器与解码器的定义,先来看编码器:
/** * Encodes higher-level message objects into binary or protocol-specific data. * MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)} * method with message which is popped from the session write queue, and then * the encoder implementation puts encoded {@link ByteBuffer}s into * {@link ProtocolEncoderOutput} by calling * {@link ProtocolEncoderOutput#write(ByteBuffer)}. * <p>协议编码器用于编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode 方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write 方法将编码后的消息放在ByteBuffer。 * Please refer to * [url=../../../../../xref-examples/org/apache/mina/examples/reverser/TextLineEncoder.html]<code>TextLineEncoder</code>[/url] * example. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public interface ProtocolEncoder { /** * Encodes higher-level message objects into binary or protocol-specific data. * MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)} * method with message which is popped from the session write queue, and then * the encoder implementation puts encoded {@link ByteBuffer}s into * {@link ProtocolEncoderOutput}. * 协议编码器用于编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode 方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write 方法将编码后的消息放在ByteBuffer。 * @throws Exception if the message violated protocol specification */ void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception; /** * Releases all resources related with this encoder. * 释放编码器关联的所有资源 * @throws Exception if failed to dispose all resources */ void dispose(IoSession session) throws Exception; }
//ProtocolEncoderAdapter
/** * An abstract {@link ProtocolEncoder} implementation for those who don't have any * resources to dispose. * ProtocolEncoderAdapter为协议编码的抽象实现,主要是对应没有任何资源要释放的协议编码。 * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public abstract class ProtocolEncoderAdapter implements ProtocolEncoder { /** * Override this method dispose all resources related with this encoder. * The default implementation does nothing. 重写dispose,释放相关资源,默认为does nothing */ public void dispose(IoSession session) throws Exception { } }
再来看协议编码输出ProtocolEncoderOutput
/** * Callback for {@link ProtocolEncoder} to generate encoded {@link ByteBuffer}s. * {@link ProtocolEncoder} must call {@link #write(ByteBuffer)} for each encoded * message. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public interface ProtocolEncoderOutput { /** * Callback for {@link ProtocolEncoder} to generate encoded * {@link ByteBuffer}s. {@link ProtocolEncoder} must call * {@link #write(ByteBuffer)} for each encoded message. * 协议编码器回调此方法,编码消息到ByteBuffer * @param buf the buffer which contains encoded data */ void write(ByteBuffer buf); /** * Merges all buffers you wrote via {@link #write(ByteBuffer)} into * one {@link ByteBuffer} and replaces the old fragmented ones with it. * This method is useful when you want to control the way MINA generates * network packets. 合并所有通过#write(ByteBuffer)产生的字节buffer,replaces the old fragmented ones with it 当你需要控制mina产生网络包的时候,此方非常有用。 */ void mergeAll(); /** * Flushes all buffers you wrote via {@link #write(ByteBuffer)} to * the session. This operation is asynchronous; please wait for * the returned {@link WriteFuture} if you want to wait for * the buffers flushed. * 刷新所有通过write(ByteBuffer)写到会话的字节buffer。此操作为异步; 如果想等待buffer刷新完成,可以等待返回的结果WriteFuture * @return <tt>null</tt> if there is nothing to flush at all. */ WriteFuture flush(); }
来看一下ProtocolEncoderOutput的简单实现
/** * A {@link ProtocolEncoderOutput} based on queue. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public abstract class SimpleProtocolEncoderOutput implements ProtocolEncoderOutput { private final Queue bufferQueue = new Queue();//buffer队列 public SimpleProtocolEncoderOutput() { } public Queue getBufferQueue() { return bufferQueue; } //将buffer添加到buffer队列 public void write(ByteBuffer buf) { bufferQueue.push(buf); } //合并 public void mergeAll() { int sum = 0; final int size = bufferQueue.size(); if (size < 2) { // no need to merge!,长度小2,不许要合并 return; } // Get the size of merged BB,计算buffer队列中,所有buffer的实际数据容量 for (int i = size - 1; i >= 0; i--) { sum += ((ByteBuffer) bufferQueue.get(i)).remaining(); } // Allocate a new BB that will contain all fragments,创建一个容量为sum的字节buffer ByteBuffer newBuf = ByteBuffer.allocate(sum); // and merge all. //遍历buffer队列所有buffer,放在newBuf中,并释放原始buffer for (;;) { ByteBuffer buf = (ByteBuffer) bufferQueue.pop(); if (buf == null) { break; } newBuf.put(buf); buf.release(); } // Push the new buffer finally.读写模式切换 newBuf.flip(); bufferQueue.push(newBuf);//将合并后的buffer添加到buffer队列 } //刷新buffer队列数据 public WriteFuture flush() { Queue bufferQueue = this.bufferQueue; WriteFuture future = null; if (bufferQueue.isEmpty()) { return null; } else { 遍历buffer队列所有buffer,发送buffer数据 for (;;) { ByteBuffer buf = (ByteBuffer) bufferQueue.pop(); if (buf == null) { break; } // Flush only when the buffer has remaining. if (buf.hasRemaining()) { //委托给doFlush future = doFlush(buf); } } } return future; } //待子类扩展 protected abstract WriteFuture doFlush(ByteBuffer buf); }
从上面可以看出编码器ProtocolEncoder主要有两个方法,encode和dispose;
encode用于,编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode
方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write方法将编码后的消息放在ByteBuffer;dispose方法释放编码器资源。ProtocolEncoderAdapter为编码器抽象实现,默认实现了dispose,不做任何事情,对于不需要释放资源的编码器继承ProtocolEncoderAdapter。ProtocolEncoderOutput主要的工作是将协议编码器编码后的
字节buffer,缓存起来,等待flush方法调用时,则将数据发送出去。SimpleProtocolEncoderOutput为ProtocolEncoderOutput的简单实现内部有一个buffer队列bufferQueue(Queue),用于存放write(ByteBuffer)方法,传入的字节buffer;mergeAll方法为合并buffer队列的所有buffer数据到一个buffer;flush方法为发送buffer队列中的所有buffer,实际发送工作委托给doFlush方法待子类实现。
来看协议编解码过滤器ProtocolCodecFilter的ProtocolEncoderOutput的内部实现:
private static class ProtocolEncoderOutputImpl extends SimpleProtocolEncoderOutput { private final IoSession session; private final NextFilter nextFilter; private final WriteRequest writeRequest; public ProtocolEncoderOutputImpl(IoSession session, NextFilter nextFilter, WriteRequest writeRequest) { this.session = session; this.nextFilter = nextFilter; this.writeRequest = writeRequest; } //doFlush protected WriteFuture doFlush(ByteBuffer buf) { //创建写操作返回结果 WriteFuture future = new DefaultWriteFuture(session); //将会话写事件filterWrite传递给下一个过滤器 nextFilter.filterWrite(session, new WriteRequest( new HiddenByteBuffer(buf), future, writeRequest .getDestination())); return future; } }
ProtocolEncoderOutputImpl的doFlush,首先将会话包装成DefaultWriteFuture,
将会话,写请求信息传递给NextFilter
//ProtocolCodecFilter
private static class HiddenByteBuffer extends ByteBufferProxy { private HiddenByteBuffer(ByteBuffer buf) { super(buf); } }
/** * A {@link ByteBuffer} that wraps a buffer and proxies any operations to it. * <p>ByteBufferProxy可以理解为字节buffer的静态代理,所有的方法都是委托给内部的字节buf。 * You can think this class like a {@link FilterOutputStream}. All operations * are proxied by default so that you can extend this class and override existing * operations selectively. You can introduce new operations, too. * 这个有点像FilterOutputStream,所有的代理操作默认都是通过内部buf完成, 亦可以选择重新一些方法 * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public class ByteBufferProxy extends ByteBuffer { /** * The buffer proxied by this proxy. */ protected ByteBuffer buf; /** * Create a new instance. * @param buf the buffer to be proxied */ protected ByteBufferProxy(ByteBuffer buf) { if (buf == null) { throw new NullPointerException("buf"); } this.buf = buf; } public void acquire() { buf.acquire(); } public void release() { buf.release(); } public ByteBuffer flip() { buf.flip(); return this; } ... 从上面看所有方法都是委托给内部buf }
这一篇,我们先看到这,自此我们了协议编解码过滤器的内部协议编解码工厂ProtocolCodecFactory,及内部的ProtocolEncoderOutputImpl,先来总结一下,至于协议编解码工厂在协议编解码过滤器ProtocolCodecFilter中的作用我们在后面的文章再说。
总结:
协议编解码过滤器ProtocolCodecFilter关联一个协议编解码工厂ProtocolCodecFactory,协议编解码工厂提供协议编码器ProtocolEncoder和解码器ProtocolDecoder;编码器将消息对象编码成二进制或协议数据,解码器将二进制或协议数据解码成消息对象。编码器ProtocolEncoder主要有两个方法,encode和dispose;encode用于,编码上层的消息对象为二进制或协议数据。mina调用编码器的#encode方法将从会话写请求队列中pop的消息,然后调用ProtocolEncoderOutput#write方法将编码后的消息放在ByteBuffer;dispose方法释放编码器资源。ProtocolEncoderAdapter为编码器抽象实现,默认实现了dispose,不做任何事情,对于不需要释放资源的编码器继承ProtocolEncoderAdapter。ProtocolEncoderOutput主要的工作是将协议编码器编码后的字节buffer,缓存起来,等待flush方法调用时,则将数据发送出去。SimpleProtocolEncoderOutput为ProtocolEncoderOutput的简单实现内部有一个buffer队列bufferQueue(Queue),用于存放write(ByteBuffer)方法,传入的字节buffer;
mergeAll方法为合并buffer队列的所有buffer数据到一个buffer;flush方法为发送buffer队列中的所有buffer,实际发送工作委托给doFlush方法待子类实现。ProtocolEncoderOutputImpl为协议编解码过滤器的内部类,ProtocolEncoderOutputImpl的doFlush,首先将会话包装成DefaultWriteFuture,将会话,写请求信息传递给NextFilter。
附:
/** * A default implementation of {@link WriteFuture}. * * @author The Apache Directory Project (mina-dev@directory.apache.org) * @version $Rev$, $Date$ */ public class DefaultWriteFuture extends DefaultIoFuture implements WriteFuture
DefaultIoFuture:
发表评论
-
Mina 报文连接器(NioDatagramConnector)
2017-06-14 08:46 1338Mina 抽象Polling连接器(A ... -
Mina 报文监听器NioDatagramAcceptor二(发送会话消息等)
2017-06-13 16:01 1488Mina 报文监听器NioDatagramAcceptor一( ... -
Mina 报文监听器NioDatagramAcceptor一(初始化,Io处理器)
2017-06-13 09:51 2501Mina Io监听器接口定义及抽象实现:http://dona ... -
Mina 报文通信简单示例
2017-06-12 09:01 2482MINA TCP简单通信实例:http://donald-dr ... -
Mina socket连接器(NioSocketConnector)
2017-06-12 08:37 4639Mina 抽象Polling连接器(AbstractPolli ... -
Mina 抽象Polling连接器(AbstractPollingIoConnector)
2017-06-11 21:29 960Mina 连接器接口定义及抽象实现(IoConnector ) ... -
Mina 连接器接口定义及抽象实现(IoConnector )
2017-06-11 13:46 1769Mina IoService接口定义及抽象实现:http:// ... -
Mina socket监听器(NioSocketAcceptor)
2017-06-09 08:44 3336Mina IoService接口定义及抽象实现:http:// ... -
Mina 抽象polling监听器
2017-06-08 22:32 708Mina Io监听器接口定义及抽象实现:http://dona ... -
Mina Io监听器接口定义及抽象实现
2017-06-07 13:02 1295Mina IoService接口定义及抽象实现:http:// ... -
Mina IoService接口定义及抽象实现
2017-06-06 23:44 1125Mina IoHandler接口定义:http://donal ... -
Mina Nio会话(Socket,DataGram)
2017-06-06 12:53 1143Mina Socket会话配置:http://donald-d ... -
Mina 抽象Io会话
2017-06-05 22:45 967Mina Io会话接口定义:http://donald-dra ... -
Mina Io会话接口定义
2017-06-04 23:15 1094Mina Nio处理器:http://donald-drape ... -
Mina Nio处理器
2017-06-04 22:19 692Mina Io处理器抽象实现:http://donald-dr ... -
Mina Io处理器抽象实现
2017-06-03 23:52 1082Mina 过滤链抽象实现:http://donald-drap ... -
Mina IoHandler接口定义
2017-06-01 21:30 1669Mina 过滤链抽象实现:http://donald-drap ... -
MINA 多路复用协议编解码器工厂二(多路复用协议解码器)
2017-06-01 12:52 2193MINA 多路复用协议编解码器工厂一(多路复用协议编码器): ... -
MINA 多路复用协议编解码器工厂一(多路复用协议编码器)
2017-05-31 22:22 1790MINA 多路分离解码器实例:http://donald-dr ... -
Mina 累计协议解码器
2017-05-31 00:09 1154MINA 编解码器实例:http://donald-drape ...
相关推荐
许多刚接触mina的朋友,对于mina的编解码器的编写很迷惑.希望这个文档可以帮助朋友们少走弯路。 资源中是一个比较典型的编解码器写法。生成了可执行文件。并对编解码器的代码有详细注释。
NULL 博文链接:https://wen866595.iteye.com/blog/1154137
mina仿qq聊天功能,自定义协议,协议的编码和解码详解,发送xml对象json,mina开发大全,详细api mina聊天 mina解码编码 mina协议开发 mina仿qq mina消息xml mina开发的在线聊天工具,mina仿qq功能,mina自定义协议,可以...
NULL 博文链接:https://thb143.iteye.com/blog/1538083
这个代码,在mina框架中,实现了编码解码,包含了服务器端发送数据的代码和作为客户端接收数据的代码。
该压缩包中有两个文件夹mina_server和minaclient,先启动mina_server,然后启动minaclient即可运行
mina编码器详解,mina编码器详解很详细哦
mina 多路分离解码
mina 协议 解包 粘包
mina框架自定义解编码器的小例子,里面包含所需的Jar,请使用JDK1.7,若无法运行,请留言
mina通信协议文档及实例,内含说明文档及实例,长短连接
mina自定义编解码 不错的资源 ----其实不怎么样,技术就是拿出来共享的,开源。大家一起前进
mina自定义编码器-自行做会话累积。apache mina编码器
最近使用Mina开发一个Java的NIO服务端程序,因此也特意学习了Apache的这个Mina框架。 引言 1 一. Mina入门 2 第一步.下载使用的Jar包 2 第二步.工程创建配置 2 第三步.服务端程序 3 第四步.客户端程序 6 第五步.长...
公司需求,做的简单的Demo,可以拓展,Mina自定义协议简单实现,象征性得收取2积分
mina学习资料 引言 1 一. Mina入门 2 第一步....第二步....第三步....第四步....第五步....二. Mina基础 9 ...添加过滤器 16 自定义编解码器 17 ...Demo3:自定义协议编解码 31 3.IoHandler接口 50 三. Mina实例 50 四. 其他 50
Mina自定义协议通信的示例
apache mina 框架 实例 自定义协议包 自定义编码器 解码器 服务端 客户端
pb4mina 用于 mina/java 服务器的协议缓冲区编码器/解码器 地位 没有计划,这只是一个快速的 PoC 项目
使用MINA自带的心跳协议编写的心跳的Demo