Skip to content

Commit

Permalink
dubbo
Browse files Browse the repository at this point in the history
  • Loading branch information
songlonqi-java committed Jul 17, 2023
1 parent 6f233ba commit db258d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,12 @@
public final class DubboNetClientAttributesGetter
implements NetClientAttributesGetter<DubboRequest, Result> {

/*
@Override
@Nullable
public String getTransport(DubboRequest request, @Nullable Result response) {
return null;
}
*/

@Nullable
@Override
public String getServerAddress(DubboRequest request) {
return request.url().getHost();
}

/* @Nullable
@Override
public String getPeerName(DubboRequest request) {
return request.url().getHost();
}*/

@Nullable
@Override
public Integer getServerPort(DubboRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,29 @@
public final class DubboNetServerAttributesGetter
implements NetServerAttributesGetter<DubboRequest,Result> {

/* @Nullable
@Override
public String getServerAddress(DubboRequest request) {
if (request.remoteAddress()!= null){
return request.remoteAddress().getHostName();
}
return "";
}*/


@Override
@Nullable
public InetSocketAddress getClientInetSocketAddress(
DubboRequest request, @Nullable Result status) {
return request.localAddress();
}

@Nullable
@Override
public InetSocketAddress getServerInetSocketAddress(
DubboRequest request, @Nullable Result status) {
// TODO: later version introduces TRANSPORT_ATTR_LOCAL_ADDR, might be a good idea to use it
return request.remoteAddress();
}

/*
@Override
@Nullable
public String getTransport(DubboRequest request) {
public String getServerAddress(DubboRequest request) {
return null;
}
*/

/*
@Nullable
@Override
public String getHostName(DubboRequest request) {
return null;
}
*/

/* @Nullable
@Override
public Integer getHostPort(DubboRequest request) {
public Integer getServerPort(DubboRequest request) {
return null;
}

@Override
@Nullable
public InetSocketAddress getPeerSocketAddress(DubboRequest request) {
public InetSocketAddress getClientInetSocketAddress(
DubboRequest request, @Nullable Result result) {
return request.remoteAddress();
}

@Nullable
@Override
public InetSocketAddress getHostSocketAddress(DubboRequest request) {
public InetSocketAddress getServerInetSocketAddress(
DubboRequest request, @Nullable Result result) {
return request.localAddress();
}*/
}
}

0 comments on commit db258d8

Please sign in to comment.