mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-07 06:07:36 +03:00
add a method to the session that blocks until it is closed
This commit is contained in:
parent
95c3db90a8
commit
cd02cc8f0f
5 changed files with 24 additions and 0 deletions
|
@ -772,6 +772,17 @@ var _ = Describe("Session", func() {
|
|||
Expect(mconn.written[0][0] & 0x02).ToNot(BeZero()) // Public Reset
|
||||
Expect(sess.runClosed).To(BeClosed())
|
||||
})
|
||||
|
||||
It("unblocks WaitUntilClosed when the run loop exists", func() {
|
||||
returned := make(chan struct{})
|
||||
go func() {
|
||||
sess.WaitUntilClosed()
|
||||
close(returned)
|
||||
}()
|
||||
Consistently(returned).ShouldNot(BeClosed())
|
||||
sess.Close(nil)
|
||||
Eventually(returned).Should(BeClosed())
|
||||
})
|
||||
})
|
||||
|
||||
Context("receiving packets", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue