Skip to content

Commit

Permalink
chore: renamed UdpTransport.stop into close
Browse files Browse the repository at this point in the history
  • Loading branch information
lchenut committed Jul 4, 2024
1 parent 61e1bc1 commit 29aa646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions tests/teststun.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import chronos
import options
import bearssl
import ./helpers
import ../webrtc/udp_transport
import ../webrtc/stun/stun_connection
import ../webrtc/stun/stun_message
Expand Down Expand Up @@ -57,7 +56,7 @@ suite "Stun message encoding/decoding":
messageIntegrity.attributeType == AttrMessageIntegrity.uint16
fingerprint.attributeType == AttrFingerprint.uint16
conn.close()
await udp.stop()
await udp.close()

asyncTest "Get BindingResponse from BindingRequest + encode & decode":
var
Expand All @@ -84,7 +83,7 @@ suite "Stun message encoding/decoding":
messageIntegrity.attributeType == AttrMessageIntegrity.uint16
fingerprint.attributeType == AttrFingerprint.uint16
conn.close()
await udp.stop()
await udp.close()

suite "Stun checkForError":
teardown:
Expand Down Expand Up @@ -116,7 +115,7 @@ suite "Stun checkForError":
check:
errorMissUsername.getAttribute(ErrorCode).get().getErrorCode() == ECBadRequest
conn.close()
await udp.stop()
await udp.close()

asyncTest "checkForError: UsernameChecker returns false":
var
Expand All @@ -138,4 +137,4 @@ suite "Stun checkForError":
check:
error.getAttribute(ErrorCode).get().getErrorCode() == ECUnauthorized
conn.close()
await udp.stop()
await udp.close()
2 changes: 1 addition & 1 deletion webrtc/udp_transport.nim
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ proc new*(T: type UdpTransport, laddr: TransportAddress): T =
trackCounter(UdpTransportTrackerName)
return self

proc stop*(self: UdpTransport) {.async: (raises: []).} =
proc close*(self: UdpTransport) {.async: (raises: []).} =
## Close an Udp Transport
##
if self.closed:
Expand Down

0 comments on commit 29aa646

Please sign in to comment.