concept DTLS client in category security

appears as: DTLS client, The DTLS client
API Security in Action

This is an excerpt from Manning's book API Security in Action.

Listing 12.3 The DTLS client
public static void main(String... args) throws Exception {
    try (var channel = new DtlsDatagramChannel(getClientContext());    #A
         var in = Files.newBufferedReader(Paths.get("test.txt"))) {    #B
        logger.info("Connecting to localhost:54321");
        channel.connect("localhost", 54321);    #C
 
        String line;
        while ((line = in.readLine()) != null) {    #D
            logger.info("Sending packet to server: {}", line);    #D
            channel.send(line.getBytes(UTF_8));    #D
        }
 
        logger.info("All packets sent");
        logger.info("Used cipher suite: {}",    #E
                channel.getSession().getCipherSuite());    #E
    }
}