Does kotlin have framework/built in lib for creati...
# server
z
Does kotlin have framework/built in lib for creating tcp server
a
<https://www.bogotobogo.com/Java/tutorials/tcp_socket_server_client.php>
you can use this but in Kotlin
z
Thanks, now i have to figure out how to send objects though it
a
Serialise the object into bytes Or convert it to json and send it
😉 1
m
TCP is just a transport layer, so you can put anything into its packets: it’s just byte chunks to the protocol. The meaning you give to those bytes depends on your application layer. Performance-wise, I’d recommend going with binary serialization, like Asad suggested. As for TCP sockets I would recommend using those exposed by Ktor and not the JDK ones: https://ktor.io/docs/servers-raw-sockets.html#sockets
z
Ktor do not support async sockets so u can not create non blocking network if im right
m
I don’t know these details, you should try to ask in #ktor directly to project maintainers
b