^ <@U6A5LE2MS>
# ktor
d
^ @otakusenpai
o
thank you very much
also can you help me with the second one?
d
Try something like:
Copy code
val stringBuilder = StringBuilder()
input.readUTF8LineTo(stringBuilder)
o
ok
d
For the second one, aSocket is not a class, but a construction function
o
oh
socket = aSocket().tcp().bind(InetSocketAddress(address,port)).accept()
so what is the return type of this?
d
Copy code
val socket: Socket = aSocket().tcpNoDelay().tcp().connect(address)
o
ok
is it java.net.Socket?
d
As a small trick, if you need to know the type of a expression you can type:
Copy code
val socket = aSocket().tcpNoDelay().tcp().connect(address)
Then put the cursor over
val socket
, and press
alt+return
then
Specify type explicitly
. In this case, the fqname is:
io.ktor.network.sockets.Socket
o
oh, the ide is pointing to java.net.socket
many thanks 🙂
d
Using the
Specify type explicitly
?
o
yes
d
I have tried, and it adds the right import after doing it and pressing return twice
o
oh wait theres also a option for io.ktor...
i didnt look at it
my bad
d
But shouldn’t be necessary.
okay
o
anyways many thanks again 😄
d
You are welcome 🙂