diff --git a/websockets/droplet.md b/websockets/droplet.md index bc103fe1..309d8573 100644 --- a/websockets/droplet.md +++ b/websockets/droplet.md @@ -18,7 +18,7 @@ drop.socket("ws") { req, ws in // ping the socket to keep it open try background { - if ws.state == .open { + while ws.state == .open { try? ws.ping() drop.console.wait(seconds: 10) // every 10 seconds }