From c24b7d83e63e2ff0a5c8c645bf2f597331f6601a Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 6 Jul 2012 15:03:07 -0700 Subject: [PATCH] Fixing close handling --- .../jetty/websocket/driver/WebSocketEventDriver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/driver/WebSocketEventDriver.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/driver/WebSocketEventDriver.java index a9e66c055f2..359f8e59d15 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/driver/WebSocketEventDriver.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/driver/WebSocketEventDriver.java @@ -136,7 +136,7 @@ public class WebSocketEventDriver implements Parser.Listener } CloseInfo close = new CloseInfo(frame); events.onClose.call(websocket,connection,close.getStatusCode(),close.getReason()); - return; + throw new CloseException(close.getStatusCode(),close.getReason()); } case BINARY: { @@ -278,6 +278,10 @@ public class WebSocketEventDriver implements Parser.Listener } } } + catch (CloseException e) + { + terminateConnection(e.getStatusCode(),e.getMessage()); + } catch (Throwable t) { unhandled(t);