Class BiDiBMessageReceiver

  • All Implemented Interfaces:
    org.bidib.jbidibc.messages.base.RawMessageListener

    public class BiDiBMessageReceiver
    extends java.lang.Object
    implements org.bidib.jbidibc.messages.base.RawMessageListener
    This class is to be registered as a raw listener for all BiDiB messages to and from the BiDiB connection. We are only interested in data received from the connection here. The data is then forwarded to to server message handler, which will send it back to the all connected clients.
    • Constructor Summary

      Constructors 
      Constructor Description
      BiDiBMessageReceiver​(org.bidib.jbidibc.net.serialovertcp.NetMessageHandler netServerMessageHandler, org.bidib.jbidibc.net.serialovertcp.NetBidibPort netPort)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void notifyReceived​(byte[] data)
      Process data received from BiDiB connection.
      void notifySend​(byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BiDiBMessageReceiver

        public BiDiBMessageReceiver​(org.bidib.jbidibc.net.serialovertcp.NetMessageHandler netServerMessageHandler,
                                    org.bidib.jbidibc.net.serialovertcp.NetBidibPort netPort)
    • Method Detail

      • notifyReceived

        public void notifyReceived​(byte[] data)
        Process data received from BiDiB connection. Send to network port. Currently we split possible multi-message packets into a sequence of single messages. TODO: forward multi-message packets.
        Specified by:
        notifyReceived in interface org.bidib.jbidibc.messages.base.RawMessageListener
        Parameters:
        data - from BiDiB connection
      • notifySend

        public void notifySend​(byte[] data)
        Specified by:
        notifySend in interface org.bidib.jbidibc.messages.base.RawMessageListener