How to use kotlin socket to create a chatroom in android

Please help me , I can create a socket chatroom with JAVA
But I don’t know how to change it in kotlin
I need Server code and Client code
Thank you

You can convert Java code to Kotlin code using Android Studio

Once you convert the code you can try to make it more idiomatic.