Class UdpConnectionMap


  • public final class UdpConnectionMap
    extends Object
    As UDP communication is handled only by one channel, it is needed to store MessageConsumers, so that we know which consumer handles which channel.
    Author:
    michal.polkorab
    • Method Detail

      • getMessageConsumer

        public static MessageConsumer getMessageConsumer​(InetSocketAddress address)
        Gets the MessageConsumer for the given address.
        Parameters:
        address - sender's address
        Returns:
        corresponding MessageConsumer
      • addConnection

        public static void addConnection​(InetSocketAddress address,
                                         MessageConsumer consumer)
        Adds a connection.
        Parameters:
        address - sender's address
        consumer - MessageConsumer to be added / paired with specified address
      • removeConnection

        public static void removeConnection​(InetSocketAddress address)
        Removes a connection.
        Parameters:
        address - sender's address