Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2015-05-06 17:17:03 +0000
committerJoakim Erdfelt2015-05-06 22:49:25 +0000
commitecac4b4912bb9571f1b3d6a5a2b76642b540bcfa (patch)
treef61a5c708bc3a201fde72a27ef87faae206acd91 /jetty-websocket/websocket-api/src
parent7e7b2e2950a8edc304b9ee9a3b555f0f2c56f320 (diff)
downloadorg.eclipse.jetty.project-ecac4b4912bb9571f1b3d6a5a2b76642b540bcfa.tar.gz
org.eclipse.jetty.project-ecac4b4912bb9571f1b3d6a5a2b76642b540bcfa.tar.xz
org.eclipse.jetty.project-ecac4b4912bb9571f1b3d6a5a2b76642b540bcfa.zip
414479 - Add WebSocketPingPongListener for those that want PING/PONG payload data
+ Adding WebSocketPingPongListener and example case
Diffstat (limited to 'jetty-websocket/websocket-api/src')
-rw-r--r--jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketPingPongListener.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketPingPongListener.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketPingPongListener.java
new file mode 100644
index 0000000000..fa74c339d8
--- /dev/null
+++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/WebSocketPingPongListener.java
@@ -0,0 +1,43 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.websocket.api;
+
+import java.nio.ByteBuffer;
+
+/**
+ * WebSocket PING/PONG Listener interface for incoming WebSocket PING/PONG frames.
+ */
+public interface WebSocketPingPongListener extends WebSocketConnectionListener
+{
+ /**
+ * A WebSocket PING has been received.
+ *
+ * @param payload
+ * the ping payload
+ */
+ void onWebSocketPing(ByteBuffer payload);
+
+ /**
+ * A WebSocket PONG has been received.
+ *
+ * @param payload
+ * the pong payload
+ */
+ void onWebSocketPong(ByteBuffer payload);
+}

Back to the top