From d525da3d62ed65e989d782e4cbb7edf221128568 Mon Sep 17 00:00:00 2001 From: Ludovic Chenut Date: Wed, 6 Mar 2024 16:47:39 +0100 Subject: [PATCH] fix: oversight on renaming variable --- webrtc/datachannel.nim | 2 +- webrtc/webrtc.nim | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/webrtc/datachannel.nim b/webrtc/datachannel.nim index 5439cef..5505a45 100644 --- a/webrtc/datachannel.nim +++ b/webrtc/datachannel.nim @@ -224,4 +224,4 @@ proc new*(_: type DataChannelConnection, conn: SctpConn): DataChannelConnection incomingStreams: newAsyncQueue[DataChannelStream](), streamId: 1'u16 # TODO: Serveur == 1, client == 2 ) - conn.readLoopFut = conn.readLoop() + result.readLoopFut = result.readLoop() diff --git a/webrtc/webrtc.nim b/webrtc/webrtc.nim index 5328c83..f67a231 100644 --- a/webrtc/webrtc.nim +++ b/webrtc/webrtc.nim @@ -28,15 +28,15 @@ type proc new*(T: typedesc[WebRTC], address: TransportAddress): T = result = T(udp: UdpConn(), stun: StunConn(), dtls: Dtls(), sctp: Sctp()) result.udp.init(address) - result.stun.init(webrtc.udp, address) - result.dtls.init(webrtc.stun, address) - result.sctp.init(webrtc.dtls, address) + result.stun.init(result.udp, address) + result.dtls.init(result.stun, address) + result.sctp.init(result.dtls, address) proc listen*(self: WebRTC) = self.sctp.listen() -proc connect*(self: WebRTC): Future[DataChannelConnection] {.async.} = - let sctpConn = await self.sctp.connect() +proc connect*(self: WebRTC, raddr: TransportAddress): Future[DataChannelConnection] {.async.} = + let sctpConn = await self.sctp.connect(raddr) # TODO: Port? result = DataChannelConnection.new(sctpConn) proc accept*(w: WebRTC): Future[DataChannelConnection] {.async.} =