Code example for DatagramChannel

Methods: close

0
 
    @Override 
    public void threadFinished() { 
        try { 
            if (channel != null) {
                channel.close();
            } 
        } catch (IOException ex) {
            log.error("Cannot close channel", ex);
        } 
    } 
 
    @Override 
    public boolean interrupt() { 
        if (channel != null && channel.isOpen()) {
            try { 
                channel.close();
            } catch (IOException ex) {
                log.warn("Exception while interrupting channel: ", ex);
                return false; 
Contextual code suggestions in your IDE  Get Codota for Java