Hi, everyone. I wanna know what the problem is. I...
# ktor
d
Hi, everyone. I wanna know what the problem is. I have a
ServerSocket
and a
Socket
accepted to this server socket with
keepAlive = true
option. If the client device connected to this
Socket
lost internet connection, this
Socket
can’t know this socket is broken. Even though I have a
keepAlive
option, can somebody helps me what’s the problem? Sever
Copy code
val serverSocket = aSocket(SelectorManager(<http://Dispatchers.IO|Dispatchers.IO>)).tcp().bind(host, port)
val socket = serverSocket.accept()
Client
Copy code
val socket = aSocket(ActorSelectorManager(<http://Dispatchers.IO|Dispatchers.IO>).tcp().connect(host, port) { keepAlive = true }
e
Hey @dongock.kim, could you make a repro? We will take a look
d
ok, i’ll share a test repo.
first of all, sorry for that these codes doesn’t work. every original codes are under company properties, so i just wrote down a simple PoC. https://github.com/uni2nd/ktor_socket_keepalive
@e5l hi, do you have any updates? thanks~
e
WIP
d
@e5l got it! thanks~