|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectudt.UDPEndPoint
public class UDPEndPoint
the UDPEndpoint takes care of sending and receiving UDP network packets,
dispatching them to the correct UDTSession
| Field Summary | |
|---|---|
static int |
DATAGRAM_SIZE
|
| Constructor Summary | |
|---|---|
UDPEndPoint()
bind to an ephemeral port on the default network interface on the machine |
|
UDPEndPoint(DatagramSocket socket)
create an endpoint on the given socket |
|
UDPEndPoint(InetAddress localAddress)
bind to any local port on the given host address |
|
UDPEndPoint(InetAddress localAddress,
int localPort)
Bind to the given address and port |
|
UDPEndPoint(int localPort)
bind to the default network interface on the machine |
|
| Method Summary | |
|---|---|
protected UDTSession |
accept(long timeout,
TimeUnit unit)
wait the given time for a new connection |
void |
addClientSession(Destination peer,
UDTSession session)
|
void |
addSession(Long destinationID,
UDTSession session)
|
protected void |
doReceive()
|
protected void |
doSend(UDTPacket packet)
|
InetAddress |
getLocalAddress()
|
int |
getLocalPort()
|
UDTSession |
getSession(Long destinationID)
|
Collection<UDTSession> |
getSessions()
|
void |
removeClientSession(Destination peer)
|
void |
sendRaw(DatagramPacket p)
|
void |
start()
|
void |
start(boolean serverSocketModeEnabled)
start the endpoint. |
void |
stop()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DATAGRAM_SIZE
| Constructor Detail |
|---|
public UDPEndPoint(DatagramSocket socket)
socket - - a UDP datagram socket
public UDPEndPoint(InetAddress localAddress)
throws SocketException,
UnknownHostException
localAddress -
SocketException
UnknownHostException
public UDPEndPoint(InetAddress localAddress,
int localPort)
throws SocketException,
UnknownHostException
localAddress - localPort - - the port to bind to. If the port is zero, the system will pick an ephemeral port.
SocketException
UnknownHostException
public UDPEndPoint(int localPort)
throws SocketException,
UnknownHostException
localPort - - the port to bind to. If the port is zero, the system will pick an ephemeral port.
SocketException
UnknownHostException
public UDPEndPoint()
throws SocketException,
UnknownHostException
SocketException
UnknownHostException| Method Detail |
|---|
public void start(boolean serverSocketModeEnabled)
true,
a new connection can be handed off to an application. The application needs to
call #accept() to get the socket
serverSocketModeEnabled - public void start()
public void stop()
public int getLocalPort()
public InetAddress getLocalAddress()
public void addSession(Long destinationID,
UDTSession session)
public void addClientSession(Destination peer,
UDTSession session)
public void removeClientSession(Destination peer)
public UDTSession getSession(Long destinationID)
public Collection<UDTSession> getSessions()
protected UDTSession accept(long timeout,
TimeUnit unit)
throws InterruptedException
timeout - - the time to waitunit - - the TimeUnit
UDTSession
InterruptedException
protected void doReceive()
throws IOException
IOException
protected void doSend(UDTPacket packet)
throws IOException
IOExceptionpublic String toString()
toString in class Object
public void sendRaw(DatagramPacket p)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||