Package net.i2p.i2ptunnel.udp
Class UDPSink
- java.lang.Object
-
- net.i2p.i2ptunnel.udp.UDPSink
-
-
Field Summary
Fields Modifier and Type Field Description protected InetAddress
remoteHost
protected int
remotePort
protected DatagramSocket
sock
-
Constructor Summary
Constructors Constructor Description UDPSink(DatagramSocket socket, InetAddress host, int port)
UDPSink(InetAddress host, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPort()
DatagramSocket
getSocket()
to pass to UDPSource constructorvoid
send(Destination src, int fromPort, int toPort, byte[] data)
void
stop()
-
-
-
Field Detail
-
sock
protected final DatagramSocket sock
-
remoteHost
protected final InetAddress remoteHost
-
remotePort
protected final int remotePort
-
-
Constructor Detail
-
UDPSink
public UDPSink(InetAddress host, int port)
- Parameters:
host
- where to sendport
- where to send- Throws:
IllegalArgumentException
- on DatagramSocket IOException
-
UDPSink
public UDPSink(DatagramSocket socket, InetAddress host, int port)
- Parameters:
socket
- existing sockethost
- where to sendport
- 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 interfaceSink
- Parameters:
src
- ignoredfromPort
- ignoredtoPort
- 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()
-
-