Attempting to come to terms with EofException condition

This commit is contained in:
Joakim Erdfelt 2012-08-03 08:49:48 -07:00
parent 57f16d750d
commit 65cb453080
4 changed files with 16 additions and 3 deletions

View File

@ -43,7 +43,11 @@ public class ControlFrameBytes<C> extends FrameBytes<C>
if (frame.getOpCode() == OpCode.CLOSE)
{
// Disconnect the connection (no more packets/frames)
connection.disconnect(true); // FIXME (should only shutdown output here)
connection.disconnect(false);
}
else
{
connection.flush();
}
}

View File

@ -53,6 +53,7 @@ public class DataFrameBytes<C> extends FrameBytes<C>
{
super.completed(context);
}
connection.flush();
}
@Override

View File

@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
import java.nio.channels.InterruptedByTimeoutException;
import java.util.concurrent.ScheduledFuture;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -67,7 +68,15 @@ public abstract class FrameBytes<C> implements Callback<C>, Runnable
@Override
public void failed(C context, Throwable x)
{
LOG.warn("failed(" + context + ")",x);
if (x instanceof EofException)
{
// Abbreviate the EofException
LOG.warn("failed(" + context + ") - " + EofException.class);
}
else
{
LOG.warn("failed(" + context + ")",x);
}
cancelTask();
callback.failed(context,x);
}

View File

@ -99,7 +99,6 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
}
flushing = false;
}
flush();
}
@Override