Enable LB and Naming for Netty.forAddress(String,int)

This swaps to the forTarget() codepath. The constructor is to make it
more convenient when extending the builder to disable checkAuthority.
This commit is contained in:
Eric Anderson 2015-11-13 19:22:11 -08:00
parent 01bf56bf8d
commit 76eaae26b8
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,7 @@ public class NettyChannelBuilder extends AbstractManagedChannelImplBuilder<Netty
* Creates a new builder with the given host and port.
*/
public static NettyChannelBuilder forAddress(String host, int port) {
return forAddress(new InetSocketAddress(host, port));
return new NettyChannelBuilder(host, port);
}
/**
@ -100,6 +100,10 @@ public class NettyChannelBuilder extends AbstractManagedChannelImplBuilder<Netty
return new NettyChannelBuilder(target);
}
protected NettyChannelBuilder(String host, int port) {
this(GrpcUtil.authorityFromHostAndPort(host, port));
}
private NettyChannelBuilder(String target) {
super(target);
}