Deactivated User
04/18/2018, 10:47 AMotakusenpai
04/18/2018, 12:14 PMDeactivated User
04/18/2018, 2:02 PMdave08
04/19/2018, 12:56 PMdave08
04/19/2018, 1:19 PMdave08
04/19/2018, 1:23 PMrouting { port(8080) { ... } ; port(9090) { ...} }
?orangy
rocketraman
04/20/2018, 1:45 AMotakusenpai
04/20/2018, 6:06 AMorangy
kevin.cianfarini
04/22/2018, 11:10 PMwiyarmir
04/23/2018, 8:36 AMwiyarmir
04/23/2018, 8:37 AMdeviant
04/23/2018, 9:09 AMdave08
04/23/2018, 12:12 PMApplicationCall
context, what's the better practice, to use suspending functions, withContext(CommonPool)
, or async { }
(since some processing can be done in parallel..)?Nail Gilaziev
04/23/2018, 5:08 PMval client = HttpClient(CIO.config {
maxConnectionsCount = 1000 // Maximum number of socket connections.
endpointConfig = EndpointConfig().apply {
maxConnectionsPerRoute = 100 // Maximum number of requests for a specific endpoint route.
pipelineMaxSize = 20 // Max number of opened endpoints.
keepAliveTime = 5000 // Max number of milliseconds to keep each connection alive.
connectTimeout = 5000 // Number of milliseconds to wait trying to connect to the server.
connectRetryAttempts = 5 // Maximum number of attempts for retrying a connection.
}
})
endpointConfig - Unable to resolve
if I understand correctly this line must be replaced to:
endpoint.apply {
Nail Gilaziev
04/24/2018, 9:21 AMTo use this feature, you need to include io.ktor:ktor-client-websocket artifact.
v
04/24/2018, 10:19 AMHttpClient(CIO).get<String>(
I've tried this with both CIO and Apache, I just get an error
No transformation found: class io.ktor.client.engine.apache.ApacheHttpResponse -> class kotlin.String
According to https://ktor.io/clients/http-client.html this should work?otakusenpai
04/24/2018, 1:14 PMv
04/24/2018, 1:16 PMContentType.Application.FormUrlEncoded
strings? I'm currently doing it manually.ubu
04/24/2018, 8:22 PMuli
04/24/2018, 9:39 PMCloseableHttpAsyncClient httpclient = HttpAsyncClients.custom()
.setMaxConnTotal(100)
.setMaxConnPerRoute(10)
.build();
otakusenpai
04/25/2018, 6:40 AMNail Gilaziev
04/25/2018, 9:09 AMincoming.mapNotNull { it as? Frame.Ping }.consumeEach { frame ->
println("ping arrived")
}
I want to use ping/pong packets to determine user online status. it is correct way or no?Nail Gilaziev
04/25/2018, 9:25 AMpingPeriod = Duration.ofSeconds(30) // Disabled (null) by default
timeout = Duration.ofSeconds(15)
When connection between client & server are unexpectedly broken(TCP not closed properly) I expect that an exception will thrown after maximum of 45 seconds.(ping period+*pong* response waiting timeout). But it not happens. What am I do wrong?
Should I independently implement this behavior through raw sockets?Raquel V
04/25/2018, 10:03 AMcall.respondWrite(contentType = ContentType.Application.GZip) {
val output = WriterOutputStream(this)
val writer = BufferedWriter(OutputStreamWriter(GZIPOutputStream(output), "UTF-8"))
...
but this is not compressing the response, do you see anything weird there? or can you point me out to other way of doing it with ktor?rocketraman
04/25/2018, 1:05 PM-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:InitialRAMFraction=2 -XX:MinRAMFraction=2 -XX:MaxRAMFraction=2
can be used on a recent JDK8 as well. As I understand it, JDK10 just makes container awareness automatic.rocketraman
04/25/2018, 1:17 PMv
04/26/2018, 9:48 AMNail Gilaziev
04/26/2018, 3:04 PM