Example usage for org.apache.commons.net.pop3 POP3Client setKeepAlive

List of usage examples for org.apache.commons.net.pop3 POP3Client setKeepAlive

Introduction

In this page you can find the example usage for org.apache.commons.net.pop3 POP3Client setKeepAlive.

Prototype

public void setKeepAlive(boolean keepAlive) throws SocketException 

Source Link

Document

Sets the SO_KEEPALIVE flag on the currently opened socket.

Usage

From source file:com.adaptris.mail.Pop3ReceiverFactory.java

@Override
POP3Client postConnectConfigure(POP3Client client) throws MailException {
    try {/*from w  w  w .  j a v a  2 s . c om*/
        if (getTcpNoDelay() != null) {
            client.setTcpNoDelay(getTcpNoDelay().booleanValue());
        }
        if (getKeepAlive() != null) {
            client.setKeepAlive(getKeepAlive().booleanValue());
        }

    } catch (SocketException e) {
        throw new MailException(e);
    }
    return client;
}