Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swallow AsynchronousCloseException and treat it as EOF.
  • Loading branch information
donaldh committed Apr 30, 2014
1 parent 77672d0 commit 5647945
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vm/jvm/runtime/org/perl6/nqp/io/AsyncSocketHandle.java
Expand Up @@ -4,13 +4,13 @@
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;

import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.HLLConfig;
Expand Down Expand Up @@ -175,7 +175,9 @@ public void completed(Integer numRead, AsyncTaskInstance task) {
@Override
public void failed(Throwable t, AsyncTaskInstance task) {
ThreadContext curTC = tc.gc.getCurrentThreadContext();
callback(curTC, task, -1, Str, Ops.box_s(t.toString(), Str, tc));
SixModelObject err = (t instanceof AsynchronousCloseException)
? Str : Ops.box_s(t.toString(), Str, curTC);
callback(curTC, task, -1, Str, err);
}

protected void callback(ThreadContext tc, AsyncTaskInstance task, long seq, SixModelObject str, SixModelObject err) {
Expand Down

0 comments on commit 5647945

Please sign in to comment.