Hey! Im looking into making a TCP Listener with Ko...
# announcements
h
Hey! Im looking into making a TCP Listener with Kotlin Native and wondered how to do that?
g
On which platform? There is no ready to use library just for tcp, only some examples on official repo for http server, as I know, you can use some platform library + wrapper for it
h
I wanted to write a K/N http server and I knew I needed a TCP Listener to start unless there is a basic HTTP Listener
g
K/N server for which OS?
h
Was thinking windows/Linux/Macod
g
Yep, approach with posix sockets will work on those, though, it's quite low level and ktor doesn't have engine for server which works on desktop yet (only client is supported)
h
Could I try make an engine for desktop?
g
Well, you definitely can try, it's doable using C libraries, you can find some c http server which works on all platforms, or use pure sockets with posix, but pure sockets for http is quite a lot of work to implement even basic things
But of course dependns on your needs, maybe some super-minimalistic http implementation would be enough by itself, but not for ktor engine
t
can you use https://github.com/lammertb/libhttp or https://github.com/davidmoreno/onion ? You need to target a specific platform no matter what, so I'd see if you can use/find a http library for every platform you intend to target.