So, I was gonna make a small IRC client and thought about using Ktor as the networking library.I quickly followed the guide and made this small snippet as an example:
import io.ktor.network.sockets.*
import kotlinx.coroutines.experimental.*
import java.net.*
fun main(args: Array<String>) {
runBlocking {
val socket = aSocket().tcp().connect(InetSocketAddress("127.0.0.1", 2323))
val input = socket.openReadChannel()
val output = socket.openWriteChannel(autoFlush = true)
output.writeBytes("hello\r\n")
val response = input.readASCIILine()
println("Server said: '$response'")
}
}
But the problem is that im getting a missing dependencies for the following:
~/Programming_Workspace/Ma_Currents/KtorExample/src/main/kotlin/com/otakusenpai/KtorExample/main.kt: (9, 22): Unresolved reference: aSocket
~//Programming_Workspace/Ma_Currents/KtorExample/src/main/kotlin/com/otakusenpai/KtorExample/main.kt: (2, 16): Unresolved reference: network
Can you guys please help me?