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.


Inner Class Summary
 class UDPConnection.PacketInputStream
          Inner class to transform packets to messages.
 
Fields inherited from class aleph.comm.udp.Connection
handler, messagesSent
 
Constructor Summary
UDPConnection(Address destination)
          Constructor.
 
Method Summary
 void close()
          Clean up at the end.
 void deliver(Packet packet)
          Deliver new packet to connection.
 void flush()
           
 boolean ping()
           
protected  Message receive()
          Pull in next message.
 void send(Message message)
          Send'em a message.
 java.lang.String toString()
           
 
Methods inherited from class aleph.comm.udp.Connection
start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UDPConnection

public UDPConnection(Address destination)
Constructor.
Parameters:
destination - partner's address
Method Detail

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