KTOR DefaultWebSocketSession.terminate() is deprec...
# ktor
k
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
it’s a special extension to make cancel() more discoverable
k
Then Does the method cancel() also clear and close socket directly without CLOSE_WAIT ?