Example usage for org.apache.commons.net.nntp NNTPClient setSoTimeout

List of usage examples for org.apache.commons.net.nntp NNTPClient setSoTimeout

Introduction

In this page you can find the example usage for org.apache.commons.net.nntp NNTPClient setSoTimeout.

Prototype

public void setSoTimeout(int timeout) throws SocketException 

Source Link

Document

Set the timeout in milliseconds of a currently open connection.

Usage

From source file:org.rssowl.contrib.internal.nntp.NewsGroupHandler.java

private void setTimeout(NNTPClient client, Map<Object, Object> properties) {

    /* Retrieve Connection Timeout from Properties if set */
    int conTimeout = DEFAULT_CON_TIMEOUT;
    if (properties != null && properties.containsKey(IConnectionPropertyConstants.CON_TIMEOUT))
        conTimeout = (Integer) properties.get(IConnectionPropertyConstants.CON_TIMEOUT);

    /* Socket Timeout - Max. time to wait for an answer */
    try {//from   w w  w  .  jav a  2  s .c om
        client.setSoTimeout(conTimeout);
    } catch (SocketException e) {
        /* Ignore */
    }
}