nl.west.aaa
Class UDPTransport
java.lang.Object
|
+--nl.west.aaa.UDPTransport
- Direct Known Subclasses:
- RadiusTransport
- public class UDPTransport
- extends java.lang.Object
- implements TransportProtocol
Constructor Summary |
protected |
UDPTransport()
Provided for subclasses handling their own socket
management. |
|
UDPTransport(int listenPort,
int sendPort)
Initialize transport over UDP. |
Method Summary |
protected void |
addSocketListener(java.net.DatagramSocket socket)
Start listening on the socket for new messages. |
void |
sendMessage(byte[] data,
Identifier id)
Send the given data to the destination. |
void |
startListening(AAAUnit receiver)
Listen for connections and pass them to the AAAUnit
useing the handleIncoming() method of the AAAUnit. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
receiver
protected AAAUnit receiver
sendSocket
protected java.net.DatagramSocket sendSocket
sendPort
protected int sendPort
UDPTransport
public UDPTransport(int listenPort,
int sendPort)
throws java.net.SocketException
- Initialize transport over UDP.
listenPort is the port that is listened on,
sendPort is the port UDP messages are sent to.
UDPTransport
protected UDPTransport()
- Provided for subclasses handling their own socket
management.
addSocketListener
protected void addSocketListener(java.net.DatagramSocket socket)
- Start listening on the socket for new messages.
Any messages will be passed to the receiver (AAAUnit).
sendMessage
public void sendMessage(byte[] data,
Identifier id)
throws java.io.IOException
- Send the given data to the destination.
The UDP packet is sent to the sendPort port
on the receiver.
- Specified by:
- sendMessage in interface TransportProtocol
startListening
public void startListening(AAAUnit receiver)
- Listen for connections and pass them to the AAAUnit
useing the handleIncoming() method of the AAAUnit.
- Specified by:
- startListening in interface TransportProtocol
|