TcpConnection
A TCP connection to a peer (or HTTP tracker). Thin coroutine wrapper over a ktor Socket exposing the two operations the wire protocol needs: read exactly N bytes, and write a frame. Replaces the bespoke async read/write buffers in libtorrent's peer_connection.
Functions
Link copied to clipboard
Adapt a proven TcpConnection to the ByteStream seam. The connection itself is untouched; this is a thin forwarding wrapper so production code feeds a real socket into PeerConnection while tests feed a fake.
Link copied to clipboard
Suspends until exactly n bytes have been read, then returns them.