diff --git a/Sources/MWBNet/ChannelConfig.swift b/Sources/MWBNet/ChannelConfig.swift index 9b9f1a1..35fd9a6 100644 --- a/Sources/MWBNet/ChannelConfig.swift +++ b/Sources/MWBNet/ChannelConfig.swift @@ -84,7 +84,7 @@ public struct ChannelConfig: Sendable, Equatable { /// Who a packet is for. /// /// `.all` reaches every trusted connection whose peer is in the matrix, which -/// is what `SkSend` does for `Des == ID.ALL` (`Common.cs:919-929`). `.peer` +/// is what `SkSend` does for `Des == ID.ALL` (`Common.cs:922-930`). `.peer` /// reaches **both** of a peer's connections when it has two; the receiver's /// replay ring collapses the duplicate, and that is the mechanism, not an /// accident (contracts C1, `Receiver.cs:40-82`). @@ -118,7 +118,8 @@ public enum DisconnectReason: Sendable, Equatable { case duplicateClient /// The peer is this machine (`SocketStuff.cs:1430-1437`). case selfConnection - /// The peer reports our own machine id (`SocketStuff.cs:1984-1992`). + /// A peer we dialled reports our own machine id; Windows checks this on + /// client sockets only (`SocketStuff.cs:1980-1992`). case idCollision /// No connection could be made within 30 s (`SocketStuff.cs:158, 1179-1198`). case timeout @@ -182,8 +183,9 @@ public protocol EngineSink: AnyObject, Sendable { _ channel: ControlChannel, disconnected peerID: UInt32?, peerName: String?, reason: DisconnectReason) - /// A trusted peer reports our own machine id. The app picks a new one, - /// hands it over in a `reconfigure(_:)` and calls `reopenAll()` - /// (`SocketStuff.cs:1984-1992`). + /// A peer we dialled reports our own machine id. The app picks a new one, + /// hands it over in a `reconfigure(_:)` and calls `reopenAll()`. Like + /// Windows, the channel only looks for this on an outbound connection + /// (`SocketStuff.cs:1980-1992`). func channelDetectedIDCollision(_ channel: ControlChannel) } diff --git a/Sources/MWBNet/ControlChannel.swift b/Sources/MWBNet/ControlChannel.swift index 8d12163..ceeac41 100644 --- a/Sources/MWBNet/ControlChannel.swift +++ b/Sources/MWBNet/ControlChannel.swift @@ -116,7 +116,7 @@ public final class ControlChannel: @unchecked Sendable { } } - /// Queues `ByeBye` on every trusted connection (`Common.cs:612-616`). Call + /// Queues `ByeBye` on every trusted connection (`Common.cs:611-615`). Call /// it before `stop()` on a clean exit. public func sayGoodbye() { queue.async { [self] in @@ -173,7 +173,7 @@ public final class ControlChannel: @unchecked Sendable { /// `.all` goes to every trusted connection whose peer is in the matrix, and /// `.peer` to both of a peer's connections when it has two — the same /// bytes, the same `Id`, exactly as `SkSend` fans one packet out over many - /// sockets (`Common.cs:912-930`). + /// sockets (`Common.cs:916-930`). public func forward(_ packet: Packet, to destination: Destination) { queue.async { [self] in let now = monotonicNow() diff --git a/Sources/MWBNet/PeerConnection.swift b/Sources/MWBNet/PeerConnection.swift index d86452f..7a81850 100644 --- a/Sources/MWBNet/PeerConnection.swift +++ b/Sources/MWBNet/PeerConnection.swift @@ -235,7 +235,7 @@ final class PeerConnection: @unchecked Sendable { pump() } - /// Queues `ByeBye` on the way out (`Common.cs:612-616`). + /// Queues `ByeBye` on the way out (`Common.cs:611-615`). func sayGoodbye() { guard status == .connected, !finished, closing == nil else { return } session.sayGoodbye()