Mark the channel as closed and unregisters all message handlers registered by the end. If handshake is still in progress, it will be aborted.
Check if the end is closed
Add a subscriber to the close event. The subscriber will be called when the end is closed at most once
Controller for closing the messaging channel