receiveLoopCatching

suspend fun receiveLoopCatching(maxMessageLength: Int = DEFAULT_MAX_MESSAGE_LENGTH, onMessage: suspend (PeerMessage) -> Unit)

Like receiveLoop but swallows the end-of-stream / cancellation exception so a normal peer disconnect returns instead of throwing. Protocol violations (ProtocolException, BadFrameLengthException) still propagate. A peer that breaks framing must be disconnected, which libtorrent does the same way.