Package io.grpc.netty
Class NettyChannelBuilder.LocalSocketPicker
- java.lang.Object
-
- io.grpc.netty.NettyChannelBuilder.LocalSocketPicker
-
- Enclosing class:
- NettyChannelBuilder
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4917") public static class NettyChannelBuilder.LocalSocketPicker extends Object
This class is meant to be overriden with a custom implementation ofcreateSocketAddress(java.net.SocketAddress, io.grpc.Attributes)
. The default implementation is a no-op.- Since:
- 1.16.0
-
-
Constructor Summary
Constructors Constructor Description LocalSocketPicker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SocketAddress
createSocketAddress(SocketAddress remoteAddress, Attributes attrs)
Called by gRPC to pick local socket to bind to.
-
-
-
Method Detail
-
createSocketAddress
@Nullable public SocketAddress createSocketAddress(SocketAddress remoteAddress, @Attr Attributes attrs)
Called by gRPC to pick local socket to bind to. This may be called multiple times. Subclasses are expected to override this method.- Parameters:
remoteAddress
- the remote address to connect to.attrs
- the Attributes present on theEquivalentAddressGroup
associated with the address.- Returns:
- a
SocketAddress
suitable for binding, or elsenull
. - Since:
- 1.16.0
-
-