You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by GitBox <gi...@apache.org> on 2022/02/07 22:05:50 UTC

[GitHub] [wicket] reiern70 commented on a change in pull request #499: [WICKET-6954] implement server side heart-beat + client reconnection in case of inactivity

reiern70 commented on a change in pull request #499:
URL: https://github.com/apache/wicket/pull/499#discussion_r801097689



##########
File path: wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/WebSocketSettings.java
##########
@@ -139,6 +142,49 @@ public static void set(Application application, WebSocketSettings settings)
 	 */
 	private IWebSocketConnectionFilter connectionFilter;
 
+	/**
+	 * Boolean used to determine if ping-pong heart beat will be used.
+	 */
+	private boolean useHeartBeat = false;
+
+
+	/**
+	 * Boolean used to determine if ping-pong heart beat will be used.
+	 */
+	private boolean usePingPongHeartBeat = false;

Review comment:
       It seems ping-pong is designed for the following use case:
   
   -server sends pings to all remote client peers and clients respond with a pong
   -server can use this to determine some connection is dead and kill it
   -it seems the standard does not include a public onping at client side. Thus browser might respond to this with a pong. Chrome responds with a pong but something like 
   
   `ws.onping = function() {}
   `
   is not called.
   
   Some implementations defines "onping" at client side. See
   
   https://github.com/websockets/ws#how-to-detect-and-close-broken-connections
   
   I have include a class that starts a ping-pong scheduler. But this can't be used a client side in order to reconnect. This uses usePingPongHeartBeat flag.
   
   I have included another timer that send special byte array... This one uses useHeartBeat and is the one used to reconnect broken web-scoket
   
   Not sure if we should keep ping-pong timer.
   
   
    
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org