|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbamboo.lss.UdpCC
public class UdpCC
A TCP-friendly datagram layer.
| Nested Class Summary | |
|---|---|
protected class |
UdpCC.BandwidthCB
|
protected class |
UdpCC.Connection
Keep track of all of the relavent information about another node we are talking to. |
protected class |
UdpCC.MyAckTimeoutCB
|
protected class |
UdpCC.MySelectableCB
|
static interface |
UdpCC.SendCB
|
static interface |
UdpCC.Serializer
|
static interface |
UdpCC.Sink
|
protected static class |
UdpCC.SrcAndMsgId
|
protected class |
UdpCC.StatsCB
|
static class |
UdpCC.TimeoutInfo
|
protected static class |
UdpCC.TimeoutInfoAndSeq
|
| Field Summary | |
|---|---|
protected UdpCC.MyAckTimeoutCB |
ack_timeout_cb
|
protected ASyncCore |
acore
|
protected static long |
BW_STATS_PERIOD
|
protected DatagramChannel |
channel
|
protected boolean |
closed
|
protected Map |
conns
|
protected boolean |
DEBUG
|
protected boolean |
DEBUG_MIN
|
protected boolean |
DEBUG_RTT
|
protected ASyncCore.TimerCB |
dup_track_cb
|
protected long |
in_bytes
|
protected long |
in_pkts
|
protected static boolean |
LOG_BAD_NETWORK_EVENTS
|
protected org.apache.log4j.Logger |
logger
|
protected Mac |
mac
|
protected static int |
MAX_MSG_SIZE
|
protected static int |
MAX_RECENTLY_SEEN_SIZE
|
protected static long |
MAX_RTO
|
protected static double |
MAX_WND
|
protected InetSocketAddress |
my_addr
|
protected long |
next_msg_id
|
protected long |
out_bytes
|
protected long |
out_pkts
|
protected long |
received_duplicates
|
protected long |
received_msgs
|
protected LinkedList |
recently_seen_list
|
protected HashSet |
recently_seen_set
|
protected static boolean |
REUSE
|
protected ByteBuffer |
reuse_buf
|
protected UdpCC.Connection |
rr_first
|
protected UdpCC.Connection |
rr_last
|
protected Map |
second_chance
|
protected PriorityQueue |
second_chance_timeouts
|
protected UdpCC.Serializer |
serializer
|
protected UdpCC.Sink |
sink
|
protected SelectionKey |
skey
|
protected DatagramSocket |
sock
|
protected int |
SOCKBUF_MAX
|
protected static long |
STATS_PERIOD
|
protected double |
timeout_diff
|
protected double |
timeout_factor
|
protected long |
track_duplicates_period
|
protected Map |
unacked
|
protected boolean |
USE_DIRECT
|
| Constructor Summary | |
|---|---|
UdpCC(ASyncCore core,
InetSocketAddress address,
UdpCC.Serializer slz,
UdpCC.Sink snk)
Construct a new UdpCC object with a UDP socket bound to address |
|
| Method Summary | |
|---|---|
protected void |
add_to_rr(UdpCC.Connection conn)
|
protected ByteBuffer |
alloc_bb(int sz)
|
protected int |
attempt(long seq)
|
protected void |
BUG(Exception e)
|
protected void |
BUG(String msg)
|
void |
close()
Closes the socket associated with this object, removes its callbacks from ASyncCore, and causes it to stop responding to any outstanding timers it has registered--in other words, turns it off. |
int |
debug_level()
|
protected void |
debugln(String msg)
|
protected void |
handle_ack(Long seq)
|
protected void |
handle_inb_msg(ByteBuffer bb,
InetSocketAddress src)
|
protected void |
handle_readable()
|
protected void |
handle_writable()
|
protected long |
inc_next_msg_id()
|
long |
last_recv(InetSocketAddress peer)
Returns the number of milliseconds since the epoch of the last time we received an acknowledgement from this peer, or 0 if we have yet to receive an acknowledgement from them. |
long |
last_send(InetSocketAddress peer)
Returns the number of milliseconds since the epoch of the last time we sent a message to this peer, or 0 if we haven't sent a message to them at all. |
long |
latency_mean(InetSocketAddress peer)
Returns the current estimate of the mean latency to this peer, or -1 if there is no current estimate. |
protected long |
make_seq(long msg_id,
int attempt)
|
protected long |
msg_id(long seq)
|
int |
queued_msgs()
Returns the number of messages waiting to be sent or currently in flight to all peers. |
int |
queued_msgs(InetSocketAddress peer)
Returns the number of messages waiting to be sent or currently in flight to this peer. |
protected boolean |
recently_seen(InetSocketAddress src,
long msg_id)
|
protected boolean |
send_ack(UdpCC.Connection conn)
|
protected boolean |
send_msg(UdpCC.Connection conn,
boolean retry)
|
void |
send_nocc(Object msg,
InetSocketAddress dst)
This is just a one-shot, minimal-delay send without an acknowledgement; Do not use this function unless you are providing some application-level congestion control. |
protected boolean |
send_probe(UdpCC.Connection conn)
|
LinkedList |
send_q(InetSocketAddress peer)
Don't use this function; I'm trying to figure out how to get rid of it. |
void |
send(Object msg,
InetSocketAddress dst,
long timeout_sec,
UdpCC.SendCB cb,
Object user_data)
Send a congestion-controlled message to another host. |
void |
set_debug_level(int value)
|
void |
set_mac_key(String keyfile)
|
void |
set_sockbuf_size(int value)
|
void |
set_timeout_diff(double value)
|
void |
set_timeout_factor(double value)
|
void |
track_duplicates(long period)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean DEBUG_MIN
protected boolean DEBUG_RTT
protected boolean DEBUG
protected long track_duplicates_period
protected long received_msgs
protected long received_duplicates
protected ASyncCore.TimerCB dup_track_cb
protected int SOCKBUF_MAX
protected org.apache.log4j.Logger logger
protected Mac mac
protected boolean USE_DIRECT
protected static final long MAX_RTO
protected static final long BW_STATS_PERIOD
protected static final long STATS_PERIOD
protected static final double MAX_WND
protected static final int MAX_MSG_SIZE
protected static final boolean LOG_BAD_NETWORK_EVENTS
protected static final boolean REUSE
protected double timeout_factor
protected double timeout_diff
protected boolean closed
protected ASyncCore acore
protected UdpCC.Serializer serializer
protected UdpCC.Sink sink
protected UdpCC.MyAckTimeoutCB ack_timeout_cb
protected SelectionKey skey
protected DatagramChannel channel
protected DatagramSocket sock
protected InetSocketAddress my_addr
protected Map unacked
protected Map second_chance
protected PriorityQueue second_chance_timeouts
protected long next_msg_id
protected UdpCC.Connection rr_first
protected UdpCC.Connection rr_last
protected Map conns
protected ByteBuffer reuse_buf
protected long in_bytes
protected long in_pkts
protected long out_bytes
protected long out_pkts
protected HashSet recently_seen_set
protected LinkedList recently_seen_list
protected static final int MAX_RECENTLY_SEEN_SIZE
| Constructor Detail |
|---|
public UdpCC(ASyncCore core,
InetSocketAddress address,
UdpCC.Serializer slz,
UdpCC.Sink snk)
address and start listening for messages.
| Method Detail |
|---|
public void track_duplicates(long period)
public void close()
public int debug_level()
public void set_debug_level(int value)
public void set_sockbuf_size(int value)
public void set_timeout_factor(double value)
public void set_timeout_diff(double value)
public void set_mac_key(String keyfile)
throws Exception
Exception
public void send_nocc(Object msg,
InetSocketAddress dst)
send(java.lang.Object, java.net.InetSocketAddress, long, bamboo.lss.UdpCC.SendCB, java.lang.Object).
public void send(Object msg,
InetSocketAddress dst,
long timeout_sec,
UdpCC.SendCB cb,
Object user_data)
tries timeouts have
occurred while trying to send it, the give callback will be called.
msg - the message to senddst - the message's destination host and porttries - the number of attempts made to send the messagecb - the callback to call when the message is
sent, or when the number of tries is exhausteduser_data - the application-specific data to call that
callback withpublic long last_send(InetSocketAddress peer)
public long last_recv(InetSocketAddress peer)
public long latency_mean(InetSocketAddress peer)
public int queued_msgs(InetSocketAddress peer)
public int queued_msgs()
public LinkedList send_q(InetSocketAddress peer)
protected void debugln(String msg)
protected final boolean recently_seen(InetSocketAddress src,
long msg_id)
protected final long inc_next_msg_id()
protected final long msg_id(long seq)
protected final int attempt(long seq)
protected final long make_seq(long msg_id,
int attempt)
protected void BUG(Exception e)
protected void BUG(String msg)
protected final ByteBuffer alloc_bb(int sz)
protected final void handle_ack(Long seq)
protected final void handle_inb_msg(ByteBuffer bb,
InetSocketAddress src)
protected final void handle_readable()
protected final boolean send_ack(UdpCC.Connection conn)
protected final boolean send_probe(UdpCC.Connection conn)
protected final boolean send_msg(UdpCC.Connection conn,
boolean retry)
protected final void add_to_rr(UdpCC.Connection conn)
protected void handle_writable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||