Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.2.8, 3.3
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use STATE_SOCK or STATE_TRANSFER instead of STATE

      Show
      Use STATE_SOCK or STATE_TRANSFER instead of STATE
    • Similar Issues:
      Show 10 results 

      Description

      When receiving state, STATE fails to correctly push the state to the receiver. There is probably a bug in BlockingInputStream, as the state itself is transferred correctly.
      STATE_TRANSFER and STATE_SOCK are not affected

        Activity

        Hide
        Bela Ban
        added a comment -

        The culprit was Draw: we use a BufferedOutputStream in DrawPanel.writeState(). This creates an internal buffer, which is flushed every 4096 bytes. This results in a message being sent to the state requester. However the buffer passed to the message is a reference to the internal buffer in BufferedOutputStream, and since this is modified again, the buffer in the message also changes !
        The solution was to copy the buffer into the message in STATE$StateOutputStream.sendMessage().

        Show
        Bela Ban
        added a comment - The culprit was Draw: we use a BufferedOutputStream in DrawPanel.writeState(). This creates an internal buffer, which is flushed every 4096 bytes. This results in a message being sent to the state requester. However the buffer passed to the message is a reference to the internal buffer in BufferedOutputStream, and since this is modified again, the buffer in the message also changes ! The solution was to copy the buffer into the message in STATE$StateOutputStream.sendMessage().

          People

          • Assignee:
            Bela Ban
            Reporter:
            Bela Ban
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: