fix windows not auto reconnecting
This commit is contained in:
parent
e95248ec5e
commit
d3e4ee71c9
|
@ -23,7 +23,7 @@ class Connection(val address: InetAddress, val port: Int = 10796) : Closeable {
|
||||||
val i: DataInputStream
|
val i: DataInputStream
|
||||||
val o: DataOutputStream
|
val o: DataOutputStream
|
||||||
|
|
||||||
if (socket == null || !socket!!.isConnected) {
|
if (socket == null || socket!!.isClosed || !socket!!.isConnected) {
|
||||||
val sock = Socket()
|
val sock = Socket()
|
||||||
sock.soTimeout = 10_000 /*ms*/
|
sock.soTimeout = 10_000 /*ms*/
|
||||||
sock.keepAlive = true
|
sock.keepAlive = true
|
||||||
|
|
Loading…
Reference in New Issue