https://kotlinlang.org logo
#ktor
Title
# ktor
k

Kepha

07/06/2020, 1:45 AM
KTOR DefaultWebSocketSession.terminate() is deprecated like this:
Copy code
/**
 * Initiate connection termination immediately. Termination may complete asynchronously.
 */
@Deprecated(
    "Use cancel() instead.",
    ReplaceWith("cancel()", "kotlinx.coroutines.cancel")
)
actual fun terminate()
What is the difference between terminate() and cancel() ?
g

gildor

07/06/2020, 2:03 AM
it’s a special extension to make cancel() more discoverable
k

Kepha

07/06/2020, 2:30 AM
Then Does the method cancel() also clear and close socket directly without CLOSE_WAIT ?
2 Views