aaa4j / aaa4j-radius

Java library for building RADIUS clients and RADIUS servers
https://aaa4j.org
Apache License 2.0
27 stars 11 forks source link

Setting timeout #15

Closed oculos closed 9 months ago

oculos commented 9 months ago

Hi,

I wonder, how can I set a value for xx seconds timeout for a client/request?

tsyd commented 9 months ago

You can set a timeout on all the requests by setting the RetransmissionStrategy when building the RadiusClient client:

RadiusClient radiusClient = UdpRadiusClient.newBuilder()
        .secret("sharedsecret".getBytes(UTF_8))
        .address(new InetSocketAddress("127.0.0.1", 1812))
        .retransmissionStrategy(new IntervalRetransmissionStrategy(1, Duration.ofSeconds(5)))
        .build();
oculos commented 9 months ago

You can set a timeout on all the requests by setting the RetransmissionStrategy when building the RadiusClient client:

RadiusClient radiusClient = UdpRadiusClient.newBuilder()
        .secret("sharedsecret".getBytes(UTF_8))
        .address(new InetSocketAddress("127.0.0.1", 1812))
        .retransmissionStrategy(new IntervalRetransmissionStrategy(1, Duration.ofSeconds(5)))
        .build();

Amazing! Thank you so much for this!