Class AbstractBytesReceiver

    • Constructor Detail

      • AbstractBytesReceiver

        public AbstractBytesReceiver​(int aCapacity)
        Constructs a AbstractBytesReceiver with a custom sized blocking queue enabling a maximum of datagrams as specified by the capacity parameter. ------------------------------------------------------------------------- Make sure your code fetches the datagrams quick enough to prevent filling up of the queue. In case the queue is filled up, adding elements via AbstractBytesDestination.pushDatagram(byte) to the queue is blocked until elements are taken from the queue via receiveByte().
        Parameters:
        aCapacity - The capacity of the queue holding the received datagrams.
    • Method Detail

      • close

        public void close()
                   throws IOException
        Specified by:
        close in interface org.refcodes.component.Closable
        Throws:
        IOException
      • isOpened

        public boolean isOpened()
        Specified by:
        isOpened in interface org.refcodes.component.ConnectionStatusAccessor
        Specified by:
        isOpened in interface org.refcodes.component.OpenedAccessor
      • isClosable

        public boolean isClosable()
        Specified by:
        isClosable in interface org.refcodes.component.Closable.CloseAutomaton
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface org.refcodes.component.ClosedAccessor
      • getConnectionStatus

        public org.refcodes.component.ConnectionStatus getConnectionStatus()
        Specified by:
        getConnectionStatus in interface org.refcodes.component.ConnectionStatusAccessor
      • setConnectionStatus

        protected void setConnectionStatus​(org.refcodes.component.ConnectionStatus aConnectionStatus)
        Sets the connection status.
        Parameters:
        aConnectionStatus - the new connection status
      • isOpenable

        protected boolean isOpenable()
        Checks if is openable.
        Returns:
        true, if is openable