Package net.i2p.i2ptunnel.udp
Class UDPSink
java.lang.Object
net.i2p.i2ptunnel.udp.UDPSink
- All Implemented Interfaces:
Sink
- Author:
- welterde
-
Field Summary
Modifier and TypeFieldDescriptionprotected final InetAddress
protected final int
protected final DatagramSocket
-
Constructor Summary
ConstructorDescriptionUDPSink
(DatagramSocket socket, InetAddress host, int port) UDPSink
(InetAddress host, int port) -
Method Summary
Modifier and TypeMethodDescriptionint
getPort()
to pass to UDPSource constructorvoid
send
(Destination src, int fromPort, int toPort, byte[] data) void
stop()
-
Field Details
-
sock
-
remoteHost
-
remotePort
protected final int remotePort
-
-
Constructor Details
-
UDPSink
- Parameters:
host
- where to sendport
- where to send- Throws:
IllegalArgumentException
- on DatagramSocket IOException
-
UDPSink
- Parameters:
socket
- existing sockethost
- where to sendport
- where to send- Since:
- 0.9.53
-
-
Method Details
-
send
- 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
to pass to UDPSource constructor -
stop
public void stop()
-