Tom Carton
04/29/2020, 9:44 AMChat Mobile Application
as such:
- a server in Kotlin
- clients using KotlinMultiplatform/Kotlin-native
I want to use sockets to exchange encrypted messages (using a simple xor for instance) in the common/shared part using Posix.
Each client displays all the messages and can send new message to the server.
The server serves all the clients with any message it received.
Nothing fancy on that side...
And the main thing I am trying to demonstrate with all this, is how I could share the maximum of code between platforms using Kotlin-native
and have clients code only responsible for the UI. Period.
So I tried to use Coroutines
to have a background thread listening to incoming messages.
These messages could come from socket (in order to be dispatched to the UI) or from UI (in order to be dispatched to socket).
But sounds like it doesn't work like this as my application often get stuck or the coroutines stop running.
I tried to use a heartbeat to wakeup the coroutines or some time-out to prevent getting stuck but this is clearly black magic and doesn't succeed anyway.
Do you have any idea or insight to point out on what I should rather do? or on what I am doing wrong?
Thank you!crummy
04/29/2020, 10:12 AMTom Carton
04/29/2020, 12:45 PMSam Garfinkel
04/29/2020, 1:15 PMTom Carton
04/29/2020, 1:17 PMSam Garfinkel
04/29/2020, 1:17 PMTom Carton
04/29/2020, 1:23 PMSam Garfinkel
04/29/2020, 8:25 PM