#1 Bug within the Java Server implementation

closed-fixed
nobody
None
5
2009-05-01
2009-04-21
Dan Oprescu
No

Hi guys,

First of all, thank you for you work it's really great and usefull.

Here's the problem I found. In the Java server code, BinaryRequestProtocol class, the method receive(Socket) creates a new BufferedInputStream to read from the socket's own stream.
This BuggeredStream is then thrown away, once the Variant is read.
The problem is that when the Excel AddIn fires a lot of data at the server very quickly, that BufferedStream starts reading data from the next Variant, and when it's thrown away we loose some bytes.

There should be 1 and only 1 BufferedInputStream for each Socket.

I guess the same goes the other way around, for the send functions.

Dan

Discussion

  • Peter Smith
    Peter Smith
    2009-04-22

    Which version of XLLoop are you using? The code listing for BinaryRequestProtocol on recent versions doesnt use a buffered stream:

    public class BinaryRequestProtocol implements RequestProtocol
    {
    public void initialise(Socket socket) throws SocketException {
    }

    public XLoper receive(Socket socket) throws IOException {
    return BinaryCodec.decode(socket.getInputStream());
    }

    public void send(Socket socket, XLoper data) throws IOException {
    BinaryCodec.encode(data, socket.getOutputStream());
    }
    }

     
  • Dan Oprescu
    Dan Oprescu
    2009-04-22

    Oops, my bad then.
    I don't know exactly which version I'm using, I downloaded it a few months ago, in Jan 09.

    In this case sorry for losing your time :)

    Dan

     
  • Peter Smith
    Peter Smith
    2009-05-01

    • status: open --> closed-fixed