close
Closes the client transport gracefully, transitioning its state to a non-operational state.
Important! This method will eventually become final. Please don't override it, or consistency guarantees might be lost.
The method is designed to operate within a suspendable context, allowing support for asynchronous behavior during the resource cleanup and state transitions.
Transitions ClientTransportState.Operational → ClientTransportState.ShuttingDown → ClientTransportState.Stopped. Calls closeResources then invokes _onClose callbacks exactly once. On kotlin.coroutines.cancellation.CancellationException, transitions to ClientTransportState.ShutdownFailed and propagates.
The method also handles unexpected exceptions gracefully during resource cleanup by transitioning the transport to the ShutdownFailed state.
Important! This method will eventually become final. Please don't override it, or consistency guarantees might be lost. Override closeResources instead.