Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpc-client/src/main/java/me/anduo/rpc/client/RpcProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public <T> T create(Class<?> interfaceClass) {

RpcClient client = new RpcClient(host, port); // 初始化 RPC 客户端
RpcResponse response = client.send(request); // 通过 RPC客户端发送RPC请求并获取RPC响应
if (response.isError()) {
if (!response.isError()) {
throw response.getError();
} else {
return response.getResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.HashMap;
import java.util.Map;

import me.anduo.rpc.common.RpcEncoder;
import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -77,7 +78,7 @@ public void initChannel(SocketChannel channel) {
/** 将RPC请求进行解码(为了处理请求)*/
new RpcDecoder(RpcRequest.class))
/** 将RPC响应进行编码(为了返回响应)*/
.addLast(new RpcDecoder(RpcResponse.class))
.addLast(new RpcEncoder(RpcResponse.class))
/** 处理RPC请求*/
.addLast(new RpcHandler(handlerMap));
}
Expand Down