mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-09 20:22:41 +02:00
Better logs on BasicRelayClient
This commit is contained in:
@@ -174,6 +174,8 @@ open class BasicRelayClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onMessage(text: String) {
|
override fun onMessage(text: String) {
|
||||||
|
// Log.d(logTag, "Receiving: $text")
|
||||||
|
|
||||||
if (text.startsWith(EVENT_MESSAGE_PREFIX)) {
|
if (text.startsWith(EVENT_MESSAGE_PREFIX)) {
|
||||||
// defers the parsing of ["EVENTS" to avoid blocking the HTTP thread
|
// defers the parsing of ["EVENTS" to avoid blocking the HTTP thread
|
||||||
scope.launch(Dispatchers.Default) {
|
scope.launch(Dispatchers.Default) {
|
||||||
@@ -239,7 +241,7 @@ open class BasicRelayClient(
|
|||||||
text: String,
|
text: String,
|
||||||
onConnected: () -> Unit,
|
onConnected: () -> Unit,
|
||||||
) {
|
) {
|
||||||
// Log.d(logTag, "Receiving: $text")
|
// Log.d(logTag, "Processing: $text")
|
||||||
stats.addBytesReceived(text.bytesUsedInMemory())
|
stats.addBytesReceived(text.bytesUsedInMemory())
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -465,7 +467,7 @@ open class BasicRelayClient(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
socket?.let {
|
socket?.let {
|
||||||
Log.d(logTag, "Sending: $str")
|
// Log.d(logTag, "Sending (${str.length} chars): $str")
|
||||||
val result = it.send(str)
|
val result = it.send(str)
|
||||||
listener.onSend(this@BasicRelayClient, str, result)
|
listener.onSend(this@BasicRelayClient, str, result)
|
||||||
stats.addBytesSent(str.bytesUsedInMemory())
|
stats.addBytesSent(str.bytesUsedInMemory())
|
||||||
|
Reference in New Issue
Block a user