Send close datagram when entering closing state
This commit is contained in:
parent
a837f4f87d
commit
f9da860c9d
|
@ -14,9 +14,16 @@ proc newClosingConnection*(finalDatagram: Datagram, ids: seq[ConnectionId],
|
|||
state.init(ids, duration)
|
||||
state
|
||||
|
||||
{.push locks: "unknown".}
|
||||
|
||||
method receive(state: ClosingConnection, datagram: Datagram) =
|
||||
proc sendFinalDatagram(state: ClosingConnection) =
|
||||
state.connection.outgoing.putNoWait(state.finalDatagram)
|
||||
|
||||
{.push locks: "unknown".}
|
||||
|
||||
method enter(state: ClosingConnection, connection: QuicConnection) =
|
||||
procCall enter(DrainingConnection(state), connection)
|
||||
state.sendFinalDatagram()
|
||||
|
||||
method receive(state: ClosingConnection, datagram: Datagram) =
|
||||
state.sendFinalDatagram()
|
||||
|
||||
{.pop.}
|
||||
|
|
|
@ -32,7 +32,7 @@ proc onTimeout(state: DrainingConnection) =
|
|||
|
||||
{.push locks: "unknown".}
|
||||
|
||||
method enter(state: DrainingConnection, connection: QuicConnection) =
|
||||
method enter*(state: DrainingConnection, connection: QuicConnection) =
|
||||
state.connection = connection
|
||||
state.timeout = newTimeout(proc = state.onTimeout())
|
||||
state.timeout.set(state.duration)
|
||||
|
|
Loading…
Reference in New Issue