Package io.grpc.netty

Class NettyChannelBuilder.LocalSocketPicker

    • Constructor Detail

      • LocalSocketPicker

        public LocalSocketPicker()
    • 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 the EquivalentAddressGroup associated with the address.
        Returns:
        a SocketAddress suitable for binding, or else null.
        Since:
        1.16.0