You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not clear (or may be a bug in library) how to send and read from tcp sockets on iOS:
Here is example code that works on jvm, but I can't make it work on ios. In both cases message is sent to server. in JVM it also receive message. But on ios it never able to read message from socket.
Common:
suspend fun connectToServer() {
val a1 = async(mainDispatcher) {
tcpClient = createTcpClient(SKES_LOCAL_URL, SKES_PORT_BASE+SK_PORTS_CONTROL, false)
println("tcpClient...")
val a2 = async(mainDispatcher) {
println("tcpClient() read")
while (true) {
println("tcpClient() wait for read")
//val data = tcpClient.readAvailable()
val buffer = ByteArray(100)
val bytesRead = tcpClient.read(buffer, 0, 20) //never returned on iOS
println("data: ${buffer.asList()}")
}
}
println("before send")
val initData = byteArrayOf(1,2,3,4,5)
tcpClient.write(initData)
println("sent")
}
println("done")
while (true) {
Thread_sleep(100)
}
}
ios:
fun connectToServer() {
runBlocking {
connectToServer()
}
}
The text was updated successfully, but these errors were encountered:
It is not clear (or may be a bug in library) how to send and read from tcp sockets on iOS:
Here is example code that works on jvm, but I can't make it work on ios. In both cases message is sent to server. in JVM it also receive message. But on ios it never able to read message from socket.
Common:
ios:
The text was updated successfully, but these errors were encountered: