aleph.comm.udp
Class UDPConnection
java.lang.Object
|
+--aleph.comm.udp.Connection
|
+--aleph.comm.udp.UDPConnection
- public class UDPConnection
- extends Connection
- implements Constants
A UDPConnection implements a reliable packet protocol using UDP packets. It
uses a thread to handle retransmissions and acknowledgments.
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
UDPConnection
public UDPConnection(Address destination)
- Constructor.
- Parameters:
destination - partner's address
deliver
public void deliver(Packet packet)
- Deliver new packet to connection.
- Parameters:
packet - new arrival.- Overrides:
- deliver in class Connection
send
public void send(Message message)
throws java.io.IOException
- Send'em a message.
- Parameters:
message - what to send- Throws:
- java.io.IOException - something's wrong
- Overrides:
- send in class Connection
receive
protected Message receive()
- Pull in next message. Blocking method.
- Overrides:
- receive in class Connection
close
public void close()
- Clean up at the end.
- Overrides:
- close in class Connection
flush
public void flush()
- Overrides:
- flush in class Connection
ping
public boolean ping()
- Overrides:
- ping in class Connection
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object