Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2165

TP.receive() should also handle InputStreams

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 4.0.2
    • None
    • None

    Description

      Currently, TP.receive() is passed a byte[] buffer as parameter. This is OK for UDP and TCP_NIO2, however, in TCP we're dealing with a socket input stream.

      TcpConnection reads the length, then copies length bytes into a byte[] buffer and finally calls TP.receive() with the byte[] buffer as argument.

      The byte[] buffer and the copying of read data into it is superfluous if TP.receive() could also accept input streams as argument.

      Therefore introduce an additional TP.receive(InputStream in, int offset, int length, which reads directly from the socket's input stream and gets rid of the intermediate byte buffer.

      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            rhn-engineering-bban Bela Ban
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: