do not log warning on SocketTimeoutExceptions

pull/4/head
Zlatin Balevsky 2018-07-28 22:19:16 +01:00
parent c98248f8b5
commit 2dc26cf7bf
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import net.i2p.client.I2PClientFactory
import net.i2p.client.I2PSession
import net.i2p.client.streaming.I2PSocketManager
import net.i2p.client.streaming.I2PSocketManagerFactory
import net.i2p.client.streaming.I2PSocketOptions
@Log
class Core {
@ -63,6 +64,8 @@ class Core {
keyDat.withInputStream {
socketManager = new I2PSocketManagerFactory().createManager(it, sysProps)
}
socketManager.getDefaultOptions().setReadTimeout(60000)
socketManager.getDefaultOptions().setConnectTimeout(30000)
i2pSession = socketManager.getSession()

View File

@ -73,6 +73,8 @@ abstract class Connection implements Closeable {
while(running.get()) {
read()
}
} catch (SocketTimeoutException e) {
close()
} catch (Exception e) {
if (running.get()) {
log.log(Level.WARNING,"unhandled exception in reader",e)