Fixing close handling

This commit is contained in:
Joakim Erdfelt 2012-07-06 15:03:07 -07:00
parent 137c6c3f2e
commit c24b7d83e6
1 changed files with 5 additions and 1 deletions

View File

@ -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);