Class RadiusClient

java.lang.Object
org.tinyradius.io.client.RadiusClient
All Implemented Interfaces:
Closeable, AutoCloseable

public class RadiusClient extends Object implements Closeable
A simple Radius client which binds to a specific socket, and can then be used to send any number of packets to any endpoints through that socket.
  • Constructor Details

    • RadiusClient

      public RadiusClient(io.netty.bootstrap.Bootstrap bootstrap, SocketAddress listenAddress, TimeoutHandler timeoutHandler, io.netty.channel.ChannelHandler handler)
      Parameters:
      bootstrap - bootstrap with channel class and eventLoopGroup set up
      listenAddress - local address to bind to
      timeoutHandler - retry strategy for scheduling retries and timeouts
      handler - ChannelHandler to handle outbound requests
  • Method Details

    • communicate

      public io.netty.util.concurrent.Future<RadiusResponse> communicate(RadiusRequest packet, List<RadiusEndpoint> endpoints)
      Sends packet to specified endpoints in turn until an endpoint succeeds or all fail.
      Parameters:
      packet - packet to send
      endpoints - endpoints to send packet to
      Returns:
      deferred response containing response packet or exception
    • communicate

      public io.netty.util.concurrent.Future<RadiusResponse> communicate(RadiusRequest packet, RadiusEndpoint endpoint)
      Sends packet to specified endpoint.
      Parameters:
      packet - packet to send
      endpoint - endpoint to send packet to
      Returns:
      deferred response containing response packet or exception
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable