mirror of https://github.com/zlatinb/muwire
do not log warning on SocketTimeoutExceptions
parent
c98248f8b5
commit
2dc26cf7bf
|
@ -20,6 +20,7 @@ import net.i2p.client.I2PClientFactory
|
||||||
import net.i2p.client.I2PSession
|
import net.i2p.client.I2PSession
|
||||||
import net.i2p.client.streaming.I2PSocketManager
|
import net.i2p.client.streaming.I2PSocketManager
|
||||||
import net.i2p.client.streaming.I2PSocketManagerFactory
|
import net.i2p.client.streaming.I2PSocketManagerFactory
|
||||||
|
import net.i2p.client.streaming.I2PSocketOptions
|
||||||
|
|
||||||
@Log
|
@Log
|
||||||
class Core {
|
class Core {
|
||||||
|
@ -63,6 +64,8 @@ class Core {
|
||||||
keyDat.withInputStream {
|
keyDat.withInputStream {
|
||||||
socketManager = new I2PSocketManagerFactory().createManager(it, sysProps)
|
socketManager = new I2PSocketManagerFactory().createManager(it, sysProps)
|
||||||
}
|
}
|
||||||
|
socketManager.getDefaultOptions().setReadTimeout(60000)
|
||||||
|
socketManager.getDefaultOptions().setConnectTimeout(30000)
|
||||||
i2pSession = socketManager.getSession()
|
i2pSession = socketManager.getSession()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,8 @@ abstract class Connection implements Closeable {
|
||||||
while(running.get()) {
|
while(running.get()) {
|
||||||
read()
|
read()
|
||||||
}
|
}
|
||||||
|
} catch (SocketTimeoutException e) {
|
||||||
|
close()
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (running.get()) {
|
if (running.get()) {
|
||||||
log.log(Level.WARNING,"unhandled exception in reader",e)
|
log.log(Level.WARNING,"unhandled exception in reader",e)
|
||||||
|
|
Loading…
Reference in New Issue