mirror of
https://github.com/vacp2p/nim-quic.git
synced 2026-01-08 21:38:05 -05:00
chore: receive should not raise error (#129)
This commit is contained in:
@@ -22,7 +22,7 @@ method send(state: ClosedConnection) =
|
||||
raise newException(ClosedConnectionError, "connection is closed")
|
||||
|
||||
method receive(state: ClosedConnection, datagram: sink Datagram) =
|
||||
raise newException(ClosedConnectionError, "connection is closed")
|
||||
warn "Receive ClosedConnection state"
|
||||
|
||||
method openStream(
|
||||
state: ClosedConnection, unidirectional: bool
|
||||
@@ -33,6 +33,4 @@ method close(state: ClosedConnection) {.async.} =
|
||||
discard
|
||||
|
||||
method drop(state: ClosedConnection) {.async.} =
|
||||
trace "Dropping ClosedConnection state"
|
||||
discard
|
||||
trace "Dropped ClosedConnection state"
|
||||
trace "Drop ClosedConnection state"
|
||||
|
||||
@@ -60,11 +60,8 @@ method close(state: DisconnectingConnection) {.async.} =
|
||||
connection.switch(newClosedConnection(state.derCertificates))
|
||||
|
||||
method drop(state: DisconnectingConnection) {.async.} =
|
||||
trace "Dropping DisconnectingConnection state"
|
||||
trace "Awaiting quic disconnecton"
|
||||
trace "Drop DisconnectingConnection state"
|
||||
await state.disconnect
|
||||
trace "Quic disconnecton finished"
|
||||
let connection = state.connection.valueOr:
|
||||
return
|
||||
connection.switch(newClosedConnection(state.derCertificates))
|
||||
trace "dropped DisconnectingConnection state"
|
||||
|
||||
Reference in New Issue
Block a user