Package io.grpc.netty

Class NettyChannelBuilder.LocalSocketPicker

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.SocketAddress createSocketAddress​(java.net.SocketAddress remoteAddress, io.grpc.Attributes attrs)
      Called by gRPC to pick local socket to bind to.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalSocketPicker

        public LocalSocketPicker()
    • Method Detail

      • createSocketAddress

        @Nullable
        public java.net.SocketAddress createSocketAddress​(java.net.SocketAddress remoteAddress,
                                                          @Attr
                                                          io.grpc.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