mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-04-25 10:50:29 +02:00
Wait for close message to be processed in test client before closing.
This commit is contained in:
parent
447fa9a279
commit
9a473b9bf1
|
@ -227,7 +227,13 @@ func (c *TestClient) CloseWithBye() {
|
|||
}
|
||||
|
||||
func (c *TestClient) Close() {
|
||||
c.conn.WriteMessage(websocket.CloseMessage, []byte{}) // nolint
|
||||
if err := c.conn.WriteMessage(websocket.CloseMessage, []byte{}); err == websocket.ErrCloseSent {
|
||||
// Already closed
|
||||
return
|
||||
}
|
||||
|
||||
// Wait a bit for close message to be processed.
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
c.conn.Close()
|
||||
|
||||
// Drain any entries in the channels to terminate the read goroutine.
|
||||
|
|
Loading…
Reference in a new issue