net.i2p.router.transport.udp
class UDPEndpoint extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROP_MAX_PORT |
static String |
PROP_MIN_PORT
8998 is monotone, and 32000 is the wrapper, so let's stay between those
|
Constructor and Description |
---|
UDPEndpoint(RouterContext ctx,
UDPTransport transport,
int listenPort,
InetAddress bindAddress) |
Modifier and Type | Method and Description |
---|---|
int |
getListenPort()
call after startup() to get actual port or -1 on startup failure
|
UDPSender |
getSender() |
UDPPacket |
receive()
Blocking call to receive the next inbound UDP packet from any peer.
|
int |
send(UDPPacket packet)
Add the packet to the outobund queue to be sent ASAP (as allowed by
the bandwidth limiter)
|
void |
setListenPort(int newPort) |
void |
shutdown() |
void |
startup()
caller should call getListenPort() after this to get the actual bound port and determine success
|
public static final String PROP_MIN_PORT
public static final String PROP_MAX_PORT
public UDPEndpoint(RouterContext ctx, UDPTransport transport, int listenPort, InetAddress bindAddress)
listenPort
- -1 or the requested port, may not be honoredbindAddress
- null okpublic void startup()
public void shutdown()
public void setListenPort(int newPort)
public int getListenPort()
public UDPSender getSender()
public int send(UDPPacket packet)
public UDPPacket receive()