Module 

Class FramingMessageSourceConduit

    • Constructor Detail

      • FramingMessageSourceConduit

        public FramingMessageSourceConduit​(StreamSourceConduit next,
                                           Pooled<java.nio.ByteBuffer> receiveBuffer)
        Construct a new instance.
        Parameters:
        next - the delegate conduit to set
        receiveBuffer - the transmit buffer to use
    • Method Detail

      • awaitReadable

        public void awaitReadable​(long time,
                                  java.util.concurrent.TimeUnit timeUnit)
                           throws java.io.IOException
        Description copied from interface: SourceConduit
        Block until this conduit becomes readable again, or until the timeout expires. This method may return spuriously before the conduit becomes readable or the timeout expires.
        Specified by:
        awaitReadable in interface SourceConduit
        Overrides:
        awaitReadable in class AbstractSourceConduit<StreamSourceConduit>
        Parameters:
        time - the time to wait
        timeUnit - the time unit
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • awaitReadable

        public void awaitReadable()
                           throws java.io.IOException
        Description copied from interface: SourceConduit
        Block until this channel becomes readable again. This method may return spuriously before the channel becomes readable.
        Specified by:
        awaitReadable in interface SourceConduit
        Overrides:
        awaitReadable in class AbstractSourceConduit<StreamSourceConduit>
        Throws:
        java.io.InterruptedIOException - if the operation is interrupted; the thread's interrupt flag will be set as well
        java.io.IOException - if an I/O error occurs
      • receive

        public int receive​(java.nio.ByteBuffer dst)
                    throws java.io.IOException
        Description copied from interface: MessageSourceConduit
        Receive a message.
        Specified by:
        receive in interface MessageSourceConduit
        Returns:
        the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
        Throws:
        java.io.IOException - if an I/O error occurs
      • receive

        public long receive​(java.nio.ByteBuffer[] dsts,
                            int offs,
                            int len)
                     throws java.io.IOException
        Description copied from interface: MessageSourceConduit
        Receive a message.
        Specified by:
        receive in interface MessageSourceConduit
        offs - the offset into the array of buffers of the first buffer to read into
        len - the number of buffers to fill
        Returns:
        the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
        Throws:
        java.io.IOException - if an I/O error occurs