otakusenpai
10/13/2018, 3:46 PMoverride suspend fun receiveUTF8Data(): String? {
var data: String? = null
var cB = StringBuilder(512)
try {
if(!input.readUTF8LineTo(cB,512))
throw Exception("BasicConnection.kt: Didn't receive data from connection!")
else data = cB.toString()
} catch (e: Throwable) {
e.printStackTrace()
socket.close()
connected = false
null
}
return data
}
And the call is lke this
val job = GlobalScope.async { data = conn.receiveUTF8Data() }
job.await()
The errors are as follows:otakusenpai
10/13/2018, 3:49 PMConnected!
Entering loop...
Received data: :<http://hitchcock.freenode.net|hitchcock.freenode.net> NOTICE * :*** Looking up your hostname...
Received data: :<http://hitchcock.freenode.net|hitchcock.freenode.net> NOTICE * :*** Checking Ident
Received data: :<http://hitchcock.freenode.net|hitchcock.freenode.net> NOTICE * :*** Couldn't look up your hostname
Received data: :<http://hitchcock.freenode.net|hitchcock.freenode.net> NOTICE * :*** No Ident response
Received data: ERROR :Closing Link: 127.0.0.1 (Connection timed out)
java.lang.Exception: BasicConnection.kt: Didn't receive data from connection!
at com.github.otakusenpai.testbot.connection.BasicConnection.receiveUTF8Data(BasicConnection.kt:103)
at com.github.otakusenpai.testbot.MainKt$main$1$job$1.doResume(main.kt:86)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:42)
at kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run(Dispatched.kt:149)
at kotlinx.coroutines.experimental.DispatchedContinuation.run(Dispatched.kt:13)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
otakusenpai
10/13/2018, 3:49 PMjava.lang.Exception: BasicBot.kt: Null value received from connection!
at com.github.otakusenpai.testbot.MainKt$main$1.doResume(main.kt:90)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:42)
at kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume(CoroutineImpl.kt:41)
at kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run(Dispatched.kt:149)
at kotlinx.coroutines.experimental.AbstractContinuation.run(AbstractContinuation.kt:19)
at kotlinx.coroutines.experimental.EventLoopBase.processNextEvent(EventLoop.kt:140)
at kotlinx.coroutines.experimental.BlockingCoroutine.joinBlocking(Builders.kt:70)
at kotlinx.coroutines.experimental.BuildersKt__BuildersKt.runBlocking(Builders.kt:46)
at kotlinx.coroutines.experimental.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.experimental.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:36)
at kotlinx.coroutines.experimental.BuildersKt.runBlocking$default(Unknown Source)
at com.github.otakusenpai.testbot.MainKt.main(main.kt:46)
Received data: null
cy
10/13/2018, 3:50 PMotakusenpai
10/13/2018, 3:51 PMcy
10/13/2018, 3:51 PMotakusenpai
10/13/2018, 3:51 PMcy
10/13/2018, 3:52 PMcy
10/13/2018, 3:52 PMDidn't receive data from connection!
then you simply have no incoming bytes at allotakusenpai
10/13/2018, 3:53 PMotakusenpai
10/13/2018, 3:53 PMcy
10/13/2018, 3:54 PMcy
10/13/2018, 3:54 PMotakusenpai
10/13/2018, 3:54 PMotakusenpai
10/13/2018, 3:55 PMcy
10/13/2018, 3:55 PMcy
10/13/2018, 3:55 PMcy
10/13/2018, 3:56 PMotakusenpai
10/13/2018, 3:57 PMcy
10/13/2018, 3:58 PM