فهرست منبع

Revise: add pong closure to websocket

Allen Huang 8 سال پیش
والد
کامیت
7a40b0ab80
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      Sources/DemoServer.swift

+ 4 - 1
Sources/DemoServer.swift

@@ -180,7 +180,10 @@ public func demoServer(_ publicDir: String) -> HttpServer {
         session.writeText(text)
         }, { (session, binary) in
         session.writeBinary(binary)
-    })
+        }, { (session, pong) in
+        // Got a pong frame
+        }
+    )
     
     server.notFoundHandler = { r in
         return .movedPermanently("https://github.com/404")