@SpiMeta(name="motan") public class DefaultRpcCodec extends AbstractCodec
| 构造器和说明 |
|---|
DefaultRpcCodec() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
decode(Channel channel,
String remoteIp,
byte[] data)
decode data
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
|
byte[] |
encode(Channel channel,
Object message) |
createInput, createOutput, deserialize, serializepublic byte[] encode(Channel channel, Object message) throws IOException
IOExceptionpublic Object decode(Channel channel, String remoteIp, byte[] data) throws IOException
对于client端:主要是来自server端的response or exception
对于server端: 主要是来自client端的request
data - remoteIp - 用来在server端decode request时能获取到client的ip。IOExceptionCopyright © 2016. All rights reserved.