Rice Pastry API

org.mpisws.p2p.transport.wire
Class UDPLayer

java.lang.Object
  extended by rice.selector.SelectionKeyHandler
      extended by org.mpisws.p2p.transport.wire.UDPLayer
All Implemented Interfaces:
Destructable

public class UDPLayer
extends SelectionKeyHandler
implements Destructable


Nested Class Summary
 class UDPLayer.Envelope
          Internal class which holds a pending datagram
 
Field Summary
 int DATAGRAM_RECEIVE_BUFFER_SIZE
           
 int DATAGRAM_SEND_BUFFER_SIZE
           
static java.util.Map<java.lang.String,java.lang.Integer> OPTIONS
           
 
Constructor Summary
UDPLayer(WireTransportLayerImpl wire)
           
 
Method Summary
 void acceptMessages(boolean b)
           
 void destroy()
           
 void modifyKey(java.nio.channels.SelectionKey key)
          DESCRIBE THE METHOD
protected  void openServerSocket()
           
 void read(java.nio.channels.SelectionKey key)
          DESCRIBE THE METHOD
protected  void readHeader(java.net.InetSocketAddress address)
           
 MessageRequestHandle<java.net.InetSocketAddress,java.nio.ByteBuffer> sendMessage(java.net.InetSocketAddress destination, java.nio.ByteBuffer msg, MessageCallback<java.net.InetSocketAddress,java.nio.ByteBuffer> deliverAckToMe, java.util.Map<java.lang.String,java.lang.Integer> options)
          The ack is not the end to end, it's called when actually sent
 void write(java.nio.channels.SelectionKey key)
          DESCRIBE THE METHOD
 
Methods inherited from class rice.selector.SelectionKeyHandler
accept, connect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTIONS

public static final java.util.Map<java.lang.String,java.lang.Integer> OPTIONS

DATAGRAM_RECEIVE_BUFFER_SIZE

public int DATAGRAM_RECEIVE_BUFFER_SIZE

DATAGRAM_SEND_BUFFER_SIZE

public int DATAGRAM_SEND_BUFFER_SIZE
Constructor Detail

UDPLayer

public UDPLayer(WireTransportLayerImpl wire)
         throws java.io.IOException
Throws:
java.io.IOException
Method Detail

sendMessage

public MessageRequestHandle<java.net.InetSocketAddress,java.nio.ByteBuffer> sendMessage(java.net.InetSocketAddress destination,
                                                                                        java.nio.ByteBuffer msg,
                                                                                        MessageCallback<java.net.InetSocketAddress,java.nio.ByteBuffer> deliverAckToMe,
                                                                                        java.util.Map<java.lang.String,java.lang.Integer> options)
The ack is not the end to end, it's called when actually sent

Parameters:
destination -
m -
deliverAckToMe - ack is when the message is sent to the wire

openServerSocket

protected void openServerSocket()
                         throws java.io.IOException
Throws:
java.io.IOException

read

public void read(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD

Overrides:
read in class SelectionKeyHandler
Parameters:
key - DESCRIBE THE PARAMETER

readHeader

protected void readHeader(java.net.InetSocketAddress address)
                   throws java.io.IOException
Throws:
java.io.IOException

write

public void write(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD

Overrides:
write in class SelectionKeyHandler
Parameters:
key - DESCRIBE THE PARAMETER

modifyKey

public void modifyKey(java.nio.channels.SelectionKey key)
DESCRIBE THE METHOD

Overrides:
modifyKey in class SelectionKeyHandler
Parameters:
key - DESCRIBE THE PARAMETER

destroy

public void destroy()
Specified by:
destroy in interface Destructable

acceptMessages

public void acceptMessages(boolean b)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection