|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mail.communication.inet.UDP
public class UDP
Nested Class Summary | |
---|---|
static class |
UDP.UDPException
|
Field Summary | |
---|---|
(package private) int |
anz
|
(package private) java.util.HashSet<java.lang.Integer> |
arrive
|
static int |
CPACKAGE
The UDP packet contains a CPackage -> there may be more packages following |
static int |
CPACKAGE_HEADER
|
(package private) long |
creation
|
(package private) byte[] |
data
|
static int |
DISCARD_TIME
the time after which missing UDP-packets are considered lost |
static int |
ECHO
content for PING : ECHO package received |
static int |
HOLE_PUNCH_REQUEST
The UDP packet is a hole punch request |
(package private) byte[] |
id
|
static int |
IP_REQUEST
content for PING : want to know my IP |
static int |
IPv4
the used IP-Address is of type IPv4 |
static int |
IPv6
the used IP-Address is of type IPv6 |
static int |
NO_REPLY
content for PING : no package received |
static int |
PING
The UDP packet is a ping OR: content for PING : PING package received |
(package private) int |
port
|
static int |
PUNCH_HOLE
The UDP packet is a command to punch a UDP hole |
static int |
PUNCH_PERFORMED
content for PING : punch was performed |
static int |
PUNCH_REJECTED
content for PING : punch will not be performed |
private static java.util.Random |
random
|
static int |
REQUEST_FAILED
content for PING : punch request failed to have any effect |
static int |
REQUEST_PERFORMED
content for PING : punch request will be performed |
(package private) java.net.InetAddress |
sender
|
static int |
SPLIT_SIZE
the max. size in bytes of created UDP-Packets |
(package private) int |
type
|
static int |
UNSUPPORTED
Reply to an unsupported package type |
static int |
YOUR_IP
The UDP packet is the answer to an IP request |
Constructor Summary | |
---|---|
UDP(java.net.DatagramPacket dp)
|
Method Summary | |
---|---|
void |
add(java.net.DatagramPacket dp)
|
static java.net.DatagramPacket[] |
build(byte[] out,
InetAddress address)
split a given byte[] into DatagramPackets |
static java.net.DatagramPacket |
build(int type,
InetAddress address,
InetAddress action)
|
boolean |
finished()
|
InetAddress |
getActionAddress()
|
java.io.InputStream |
getInput()
|
int |
getResponse()
|
InetAddress |
getSender()
|
int |
getType()
|
static java.net.DatagramPacket |
ping(int echo,
InetAddress address)
sends a ping, or answers a ping. |
boolean |
tooOld()
|
java.lang.String |
toString()
|
static java.net.DatagramPacket |
unsupported(UDP unsupported)
|
boolean |
useable(java.net.DatagramPacket dp)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SPLIT_SIZE
public static final int CPACKAGE_HEADER
public static final int UNSUPPORTED
public static final int CPACKAGE
public static final int PING
public static final int HOLE_PUNCH_REQUEST
public static final int PUNCH_HOLE
public static final int YOUR_IP
public static final int IPv4
public static final int IPv6
public static final int NO_REPLY
public static final int ECHO
public static final int PUNCH_PERFORMED
public static final int PUNCH_REJECTED
public static final int REQUEST_PERFORMED
public static final int REQUEST_FAILED
public static final int IP_REQUEST
public static final int DISCARD_TIME
private static final java.util.Random random
int type
byte[] data
java.net.InetAddress sender
int port
long creation
byte[] id
int anz
java.util.HashSet<java.lang.Integer> arrive
Constructor Detail |
---|
public UDP(java.net.DatagramPacket dp)
Method Detail |
---|
public static java.net.DatagramPacket[] build(byte[] out, InetAddress address)
out
- the byte[] to splitaddress
- the address to encode into the DatagramPacketS
public static java.net.DatagramPacket ping(int echo, InetAddress address)
echo
- either ECHO or PING, use ECHO as response for PING + Responses for UDP-Hole-Punchingaddress
-
public static java.net.DatagramPacket build(int type, InetAddress address, InetAddress action) throws UDP.UDPException
UDP.UDPException
public static java.net.DatagramPacket unsupported(UDP unsupported)
public boolean tooOld()
public void add(java.net.DatagramPacket dp) throws UDP.UDPException
UDP.UDPException
public boolean useable(java.net.DatagramPacket dp)
public boolean finished()
public java.io.InputStream getInput() throws UDP.UDPException
UDP.UDPException
public int getType()
public InetAddress getSender()
public InetAddress getActionAddress() throws UDP.UDPException
UDP.UDPException
public int getResponse() throws UDP.UDPException
UDP.UDPException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |