Class UDPSink

  • All Implemented Interfaces:
    Sink

    public class UDPSink
    extends Object
    implements Sink
    Author:
    welterde
    • Field Detail

      • remotePort

        protected final int remotePort
    • Constructor Detail

      • UDPSink

        public UDPSink​(InetAddress host,
                       int port)
        Parameters:
        host - where to send
        port - where to send
        Throws:
        IllegalArgumentException - on DatagramSocket IOException
      • UDPSink

        public UDPSink​(DatagramSocket socket,
                       InetAddress host,
                       int port)
        Parameters:
        socket - existing socket
        host - where to send
        port - where to send
        Since:
        0.9.53
    • Method Detail

      • send

        public void send​(Destination src,
                         int fromPort,
                         int toPort,
                         byte[] data)
        Specified by:
        send in interface Sink
        Parameters:
        src - ignored
        fromPort - ignored
        toPort - ignored
        Throws:
        RuntimeException - on DatagramSocket IOException
        Since:
        0.9.53 added fromPort and toPort parameters, breaking change, sorry
      • getPort

        public int getPort()
        Returns:
        the local port of the DatagramSocket we are sending from
      • getSocket

        public DatagramSocket getSocket()
        to pass to UDPSource constructor
      • stop

        public void stop()