Setting connection timeout |
You may define the connection timeout invoking the Nttp#setTimeout method providing the maximum timeout in milliseconds as an argument. Failure to establish a connection with the define timeout will result in an NntpException thrown.
Example
// create new Nntp instance Nntp nntp = new Nntp("news.server.com");
// set timeout to 5 seconds nntp.setTimeout(5000);
// attempt connection nntp.connect(); |