fix windows not auto reconnecting

This commit is contained in:
CodeSteak 2019-06-19 21:33:21 +02:00
parent e95248ec5e
commit d3e4ee71c9
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class Connection(val address: InetAddress, val port: Int = 10796) : Closeable {
val i: DataInputStream
val o: DataOutputStream
if (socket == null || !socket!!.isConnected) {
if (socket == null || socket!!.isClosed || !socket!!.isConnected) {
val sock = Socket()
sock.soTimeout = 10_000 /*ms*/
sock.keepAlive = true