Seems to be a JVM bug

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;

public class TestBufferedInputStreams {

        public static class DelayedInputStream extends InputStream {

                private int delay;

                public DelayedInputStream(int delay) {
                        this.delay = delay;
                }

                @Override
                public int read() throws IOException {
                        return 0;
                }

                @Override
                public int read(byte[] b, int off, int len) throws IOException{

                        if (delay-- > 0)
                                return 0;

                        for (int i = 0; i < len; i++)
                                b[i + off] = (byte) read();

                        return len;

                }

        }

        public static void main(String... args) throws Exception {

                // should return 0 but returns -1
                System.out.println(new BufferedInputStream(new 
DelayedInputStream(100)).read());
        }

---

** [bugs:#791] BinaryChannel randomly close itself if IBB is used as transport 
layer**

**Status:** pending-remind
**Created:** Wed Mar 06, 2013 03:33 PM UTC by Daniele Segato
**Last Updated:** Wed Mar 20, 2013 01:24 AM UTC
**Owner:** nobody

When I have to send initial files for the synchronization (say 1.5 mb) and the 
direct connection is not available very often the connection is lost with a 
message (for the host) that say the other buddy closed the connection, which is 
not true.



---

Sent from sourceforge.net because you indicated interest in 
<https://sourceforge.net/p/dpp/bugs/791/>

To unsubscribe from further messages, please visit 
<https://sourceforge.net/auth/prefs/>
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Dpp-robot mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dpp-robot

Reply via email to