ktorio / ktorio/ktor

Boringssl error when using IOS Engine

Open
#935 4 comments 0 reactions 1 assignee Claimed by @e5l View on GitHub
Dominant language
Kotlin
Stars
14.5k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
49

Description

I using **ktor_version = '1.1.2'** and **implementation "io.ktor:ktor-client-ios:$ktor_version"**
When I call post request from swift code to kotlin-native, so I don't see reponse from server (Android call success). Please help me!!! Thank you.
This is my code
//Swift
```
override func viewWillAppear(_ animated: Bool) {
CommonKt.loginTestAbc(callback :self)
}
```

//Kotlin-ios
```
actual class HttpClientEngineHelper {

actual fun getEngine(): HttpClientEngine {
val config = IosClientEngineConfig()
config.configureRequest {
// setTimeoutInterval(5.0)
}
return IosClientEngine(config)
}
}
```

//Kotlin common
```
private val client : HttpClient by lazy {
HttpClient(HttpClientEngineHelper().getEngine()) {

}
}
```

```
//MARK: call api
fun login(callback : OnListenerResponseApi) {
LogVnd.r("login")
try {
GlobalScope.launch { // launch new coroutine in the scope of runBlocking
LogVnd.r("login launch")
reqLogin(ReqLoginModel("username", "password"), callback)
}
} catch (e : Exception){
LogVnd.r(e.message)
callback.onError(e.message)
}
}

suspend fun reqLogin(reqLoginModel: ReqLoginModel, callback: OnListenerResponseApi) {
try {
LogVnd.r("reqLogin")
val res = client.call(loginUrl) {
method = HttpMethod.Post
addHeader(headers)
body = TextContent(Json.stringify(ReqLoginModel.serializer(), reqLoginModel), ContentType.Application.Json)
LogVnd.d(ApiHelper.TAG, "$body")
}.response
LogVnd.d(
TAG,
"RES $res"
)
processResponseData(res, ResLoginModel::class, callback)
} catch (e: Exception) {
LogVnd.e(e)
callback.onException()
}
}

```
//Error from xcode after long time
019-02-08 17:35:51.111323+0700 DPro[35228:2047919] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7f89e9513e00] get output frames failed, state 8196
2019-02-08 17:35:51.111739+0700 DPro[35228:2047919] [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) [C1.1:2][0x7f89e9513e00] get output frames failed, state 8196
2019-02-08 17:35:51.113152+0700 DPro[35228:2047919] TIC Read Status [1:0x0]: 1:57
2019-02-08 17:35:51.113267+0700 DPro[35228:2047919] TIC Read Status [1:0x0]: 1:57

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.