From f788260abd097308fb5f560baca2345a59d4175f Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Thu, 3 Sep 2020 14:58:09 +1000 Subject: [PATCH] Issue #4824 - use WritePendingException instead of IOException Signed-off-by: Lachlan Roberts --- .../jetty/websocket/common/WebSocketRemoteEndpoint.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpoint.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpoint.java index aa827f3754a..c047cb9481f 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpoint.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketRemoteEndpoint.java @@ -21,6 +21,7 @@ package org.eclipse.jetty.websocket.common; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; +import java.nio.channels.WritePendingException; import java.nio.charset.StandardCharsets; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; @@ -313,7 +314,7 @@ public class WebSocketRemoteEndpoint implements RemoteEndpoint callback = from(callback, numOutgoingFrames::decrementAndGet); if (outgoingFrames > maxNumOutgoingFrames) { - callback.writeFailed(new IOException("Exceeded max outgoing frames: " + outgoingFrames + ">" + maxNumOutgoingFrames)); + callback.writeFailed(new WritePendingException()); return; } }