mirror of https://github.com/vacp2p/nim-quic.git
Remove close event on QuicConnection
This commit is contained in:
parent
15e3c4cf1c
commit
a837f4f87d
|
@ -13,9 +13,6 @@ proc newClosedConnection*: ClosedConnection =
|
|||
|
||||
{.push locks: "unknown".}
|
||||
|
||||
method enter(state: ClosedConnection, connection: QuicConnection) =
|
||||
connection.closed.fire()
|
||||
|
||||
method ids(state: ClosedConnection): seq[ConnectionId] =
|
||||
@[]
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ type
|
|||
outgoing*: AsyncQueue[Datagram]
|
||||
incoming*: AsyncQueue[Stream]
|
||||
handshake*: AsyncEvent
|
||||
closed*: AsyncEvent
|
||||
disconnect*: proc(): Future[void] {.gcsafe.}
|
||||
ConnectionState* = ref object of RootObj
|
||||
IdCallback* = proc(id: ConnectionId)
|
||||
|
@ -55,7 +54,6 @@ proc newQuicConnection*(state: ConnectionState): QuicConnection =
|
|||
outgoing: newAsyncQueue[Datagram](),
|
||||
incoming: newAsyncQueue[Stream](),
|
||||
handshake: newAsyncEvent(),
|
||||
closed: newAsyncEvent()
|
||||
)
|
||||
state.enter(connection)
|
||||
connection
|
||||
|
|
|
@ -70,11 +70,6 @@ suite "quic connection":
|
|||
await server.handshake.wait()
|
||||
check newId != ConnectionId.default
|
||||
|
||||
asynctest "fires event when closed":
|
||||
let client = newQuicClientConnection(zeroAddress, zeroAddress)
|
||||
await client.drop()
|
||||
check client.closed.isSet()
|
||||
|
||||
asynctest "raises ConnectionError when closed":
|
||||
let connection = newQuicClientConnection(zeroAddress, zeroAddress)
|
||||
await connection.drop()
|
||||
|
|
Loading…
Reference in New Issue