https://kotlinlang.org logo
#announcements
Title
# announcements
a

AndreyVanDenHaag

11/06/2019, 3:29 PM
Hi all, I would like to try Ktor to implement a server for a TCP based protocol. All the documentation and examples are about HTTP. The only docs I could find is this: https://ktor.io/servers/raw-sockets.html Can anyone point me to a blog or a project to get more information how to implement non-HTTP protocol with Ktor ?
f

fred.deschenes

11/06/2019, 3:34 PM
Why not use something like Vert.x?
r

Rory Armstrong

11/06/2019, 3:35 PM
Try #ktor
a

AndreyVanDenHaag

11/06/2019, 3:36 PM
Thank you. I will.
I would like to compare using Netty and Ktor for TCP based protocol.
m

Matteo Mirk

11/08/2019, 3:39 PM
Ktor uses Netty as one of its server implementations, but it’s made for HTTP at a higher level, so if you want to use TCP you’ll have to either use Netty directly or maybe Korio (https://github.com/korlibs/korio) which includes a TCP server
a

AndreyVanDenHaag

11/21/2019, 6:28 AM
Thank you, Matteo ! I will have a look.
m

Matteo Mirk

11/21/2019, 1:47 PM
you’re welcome 👍
Sorry about my inexact answer above, I didn’t remember ktor provided TCP/UDP sockets, so yes you can use it to make a TCP server.
6 Views