1
0
mirror of https://github.com/fumiama/simple-dict-android.git synced 2026-06-05 00:30:24 +08:00
1. 增加设置/删除鉴权
2. 设置时自动去除多余空格并转换为半角
3. 修复无网络的可能闪退
This commit is contained in:
fumiama
2021-05-04 16:50:45 +08:00
parent 8fad5d2ab7
commit 5babde1044

View File

@@ -71,9 +71,11 @@ class Client(private val ip: String, private val port: Int) {
var a: Int var a: Int
do { do {
a = din?.read(inMessage)?:0 //a存储返回消息的长度 a = din?.read(inMessage)?:0 //a存储返回消息的长度
re += inMessage.copyOf(a) if(a > 0) {
Log.d("MyC", "reply length:$a") re += inMessage.copyOf(a)
if(totalSize < 0 && a < bufferSize) break Log.d("MyC", "reply length:$a")
if(totalSize < 0 && a < bufferSize) break
} else break
} while (totalSize > re.size) } while (totalSize > re.size)
} else Log.d("MyC", "no connect to receive message") } else Log.d("MyC", "no connect to receive message")
} catch (e: IOException) { } catch (e: IOException) {