Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:CSEMike/OneSwarm

  • Loading branch information...
commit 21402985341529bc2a400362bd59626591490ef1 2 parents 0518ab4 + 6b17acb
Tomas Isdal isdal authored
4 javatests/edu/washington/cs/oneswarm/test/integration/oop/LocalOneSwarmCoordinatee.java
View
@@ -1,6 +1,7 @@
package edu.washington.cs.oneswarm.test.integration.oop;
import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
@@ -107,6 +108,9 @@ public void run() {
String response = commands.toString();
ExperimentalHarnessManager.get().enqueue(response.split("\n"));
+ } catch (FileNotFoundException e) {
+ // Server isn't up.
+ logger.fine("Server isn't up, will try again in a minute.");
} catch (Exception e) {
e.printStackTrace();
}
2  oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/datagram/DatagramConnection.java
View
@@ -298,7 +298,7 @@ boolean messageReceived(DatagramPacket packet) {
// The message length is 1 (for the type field) + the actual
// message length.
int messageLength = decryptBuffer.getInt();
- if (messageLength > MAX_DATAGRAM_SIZE) {
+ if (messageLength > MAX_DATAGRAM_SIZE || messageLength < 0) {
logger.warning("got oversized length field!");
return false;
}
2  oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/messaging/OSF2FChannelMsg.java
View
@@ -59,7 +59,7 @@ public boolean isDatagram() {
}
public void setDatagram(boolean datagram) {
- this.datagram = true;
+ this.datagram = datagram;
}
}
25 oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/MessageStreamMultiplexer.java
View
@@ -9,8 +9,6 @@
import org.gudy.azureus2.core3.util.DirectByteBuffer;
-import com.google.common.collect.HashMultimap;
-
/**
* Multiplexes a stream of data, and tracks what is in
* transit across channels.
@@ -25,22 +23,23 @@
private final HashMap<Integer, ServiceChannelEndpoint> channels;
private final HashMap<Integer, SequenceNumber> outstandingMessages;
- private final HashMultimap<Integer, SequenceNumber> channelOutstanding;
+ private final HashMap<Integer, Set<SequenceNumber>> channelOutstanding;
private final static byte ss = 44;
public MessageStreamMultiplexer(short flow) {
this.channels = new HashMap<Integer, ServiceChannelEndpoint>();
this.outstandingMessages = new HashMap<Integer, SequenceNumber>();
- this.channelOutstanding = HashMultimap.create();
+ this.channelOutstanding = new HashMap<Integer, Set<SequenceNumber>>();
this.flow = flow;
next = 0;
}
public void addChannel(ServiceChannelEndpoint s) {
this.channels.put(s.getChannelId(), s);
+ this.channelOutstanding.put(s.getChannelId(), new HashSet<SequenceNumber>());
}
- public void onAck(OSF2FServiceDataMsg message) {
+ public int onAck(OSF2FServiceDataMsg message) {
// Parse acknowledged messages
DirectByteBuffer payload = message.getPayload();
HashSet<SequenceNumber> numbers = new HashSet<SequenceNumber>();
@@ -65,7 +64,7 @@ public void onAck(OSF2FServiceDataMsg message) {
seq.ack();
for (Integer channelId : seq.getChannels()) {
if (this.channels.get(channelId).forgetMessage(seq)) {
- channelOutstanding.remove(channelId, seq);
+ channelOutstanding.get(channelId).remove(seq);
seq.removeChannel(channelId);
}
}
@@ -76,6 +75,7 @@ public void onAck(OSF2FServiceDataMsg message) {
for (Integer num : retransmissions) {
logger.info("Non outstanding packet acked: " + num);
}
+ return numbers.size();
}
public SequenceNumber nextMsg() {
@@ -88,7 +88,7 @@ public SequenceNumber nextMsg() {
public void sendMsg(SequenceNumber msg, ServiceChannelEndpoint channel) {
int channelId = channel.getChannelId();
msg.addChannel(channelId);
- channelOutstanding.put(channelId, msg);
+ channelOutstanding.get(channelId).add(msg);
}
public boolean hasOutstanding(ServiceChannelEndpoint channel) {
@@ -100,7 +100,7 @@ public boolean hasOutstanding(ServiceChannelEndpoint channel) {
HashMap<SequenceNumber, DirectByteBuffer> mapping = new HashMap<SequenceNumber, DirectByteBuffer>();
for (SequenceNumber s : outstanding) {
DirectByteBuffer msg = channel.getMessage(s);
- if (msg != null) {
+ if (msg != null && !s.isAcked()) {
mapping.put(s, msg);
}
}
@@ -110,9 +110,12 @@ public boolean hasOutstanding(ServiceChannelEndpoint channel) {
public void removeChannel(ServiceChannelEndpoint channel) {
int channelId = channel.getChannelId();
channels.remove(channelId);
- for (SequenceNumber s : channelOutstanding.get(channelId)) {
- s.removeChannel(channelId);
+ Set<SequenceNumber> inFlight = channelOutstanding.get(channelId);
+ if (inFlight != null) {
+ for (SequenceNumber s : inFlight) {
+ s.removeChannel(channelId);
+ }
+ channelOutstanding.remove(channelId);
}
- channelOutstanding.removeAll(channelId);
}
}
3  oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/OSF2FServiceDataMsg.java
View
@@ -46,7 +46,7 @@ private OSF2FServiceDataMsg(byte _version, int channelID, int sequenceNumber, sh
}
static OSF2FServiceDataMsg acknowledge(byte _version, int channelID, short subchannel,
- int[] acknowledgements) {
+ int[] acknowledgements, boolean datagram) {
int payloadSize = acknowledgements.length - 1;
DirectByteBuffer data = null;
if (payloadSize > 0) {
@@ -58,6 +58,7 @@ static OSF2FServiceDataMsg acknowledge(byte _version, int channelID, short subch
}
OSF2FServiceDataMsg msg = new OSF2FServiceDataMsg(_version, channelID, acknowledgements[0],
subchannel, new int[0], data, (byte) 8);
+ msg.setDatagram(datagram);
return msg;
}
2  oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/SequenceNumber.java
View
@@ -57,6 +57,6 @@ public short getFlow() {
@Override
public String toString() {
- return "[message " + this.number + "." + this.flow + "]";
+ return "[flow " + this.flow + " message " + this.number + "]";
}
}
152 oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/ServiceChannelEndpoint.java
View
@@ -35,8 +35,11 @@
public class ServiceChannelEndpoint extends OverlayEndpoint {
public final static Logger logger = Logger.getLogger(ServiceChannelEndpoint.class.getName());
private static final byte ss = 0;
+ // Moving average sampling weight for latency estimation.
private static final double EWMA = 0.25;
- private static final double RETRANSMISSION_PERIOD = 2;
+ // How long (in # RTT) before packet retransmission.
+ private static final double RETRANSMISSION_MIN = 2;
+ private static final double RETRANSMISSION_MAX = 3;
public static final int MAX_SERVICE_MESSAGE_SIZE = 1024;
@@ -78,6 +81,9 @@ public void addDelegate(ServiceChannelEndpointDelegate d, short flow) {
this.delegateOrder.add(flow);
}
this.delegates.put(flow, d);
+ if (friendConnection.isReadyForWrite(null)) {
+ d.channelIsReady(this);
+ }
}
public void removeDelegate(ServiceChannelEndpointDelegate d) {
@@ -159,14 +165,16 @@ protected void handleDelayedOverlayMessage(OSF2FChannelDataMsg msg) {
start();
}
if (!(msg instanceof OSF2FServiceDataMsg)) {
+ logger.warning("Msg wasn't SDM: " + msg.getDescription());
return;
}
OSF2FServiceDataMsg newMessage = (OSF2FServiceDataMsg) msg;
// logger.fine("Received msg with sequence number " +
if (!newMessage.isAck()) {
- logger.finest("ack enqueued for " + newMessage.getSequenceNumber());
+ logger.finest("ack enqueued for " + newMessage.getDescription());
super.writeMessage(OSF2FServiceDataMsg.acknowledge(OSF2FMessage.CURRENT_VERSION,
- channelId, (short) 0, new int[] { newMessage.getSequenceNumber() }));
+ channelId, newMessage.getSubchannel(),
+ new int[] { newMessage.getSequenceNumber() }, newMessage.isDatagram()));
}
for (ServiceChannelEndpointDelegate d : this.delegates.values()) {
@@ -181,49 +189,67 @@ public long getServiceKey() {
}
public void writeMessage(final SequenceNumber num, DirectByteBuffer buffer, boolean datagram) {
+ // Move the requester to the bottom of the priority list.
try {
this.delegateOrder.remove(num.getFlow());
} catch (IndexOutOfBoundsException e) {
return;
}
this.delegateOrder.add(num.getFlow());
- writeMessage(num, buffer, 0, datagram);
- }
- private void writeMessage(final SequenceNumber num, DirectByteBuffer buffer, int attempt,
- boolean datagram) {
boolean rst = buffer == null;
if (buffer == null) {
buffer = new DirectByteBuffer(ByteBuffer.allocate(0));
}
+
int length = buffer.remaining(ss);
- ReferenceCountedDirectByteBuffer copy = buffer.getReferenceCountedBuffer();
- sentMessage sent = new sentMessage(num, copy, length, attempt, datagram);
- this.sentMessages.put(num, sent);
- this.outstandingBytes += length;
- OSF2FServiceDataMsg msg = new OSF2FServiceDataMsg(OSF2FMessage.CURRENT_VERSION, channelId,
- num.getNum(), num.getFlow(), new int[0], copy);
- if (num.getNum() == 0 && !rst) {
+ ReferenceCountedDirectByteBuffer cpy = buffer.getReferenceCountedBuffer();
+ sentMessage msg = new sentMessage(num, cpy, length, 0, datagram, rst);
+
+ writeMessage(msg);
+ }
+
+ private void writeMessage(sentMessage msg) {
+ SequenceNumber num = msg.num;
+ synchronized (sentMessages) {
+ this.sentMessages.put(num, msg);
+ }
+ this.outstandingBytes += msg.length;
+
+ double retransmit = RETRANSMISSION_MIN + (RETRANSMISSION_MAX - RETRANSMISSION_MIN)
+ * Math.random();
+ // Remember the message may need to be retransmitted.
+ delayedExecutor.queue((long) (retransmit * this.latency * (1 << msg.attempt)), msg);
+
+ if (msg.attempt > 0 && msg.creation + latency > System.currentTimeMillis()) {
+ logger.warning("Skipping over-aggresive retransmission.");
+ return;
+ }
+ msg.creation = System.currentTimeMillis();
+
+ // Outgoing msg will be freed by super.writeMessage.
+ msg.msg.incrementReferenceCount();
+ OSF2FServiceDataMsg outgoing = new OSF2FServiceDataMsg(OSF2FMessage.CURRENT_VERSION,
+ channelId, num.getNum(), num.getFlow(), new int[0], msg.msg);
+
+ if (num.getNum() == 0 && !msg.rst) {
// Mark SYN messages.
- msg.setControlFlag(4);
+ outgoing.setControlFlag(4);
}
- if (rst) {
- msg.setControlFlag(2);
+ if (msg.rst) {
+ outgoing.setControlFlag(2);
}
- if (datagram) {
+ if (msg.datagram) {
// Set datagram flag to allow the packet to be sent over UDP.
- msg.setDatagram(true);
+ outgoing.setDatagram(true);
}
- long totalWritten = buffer.remaining(DirectByteBuffer.SS_MSG);
+ long totalWritten = msg.length;
if (logger.isLoggable(Level.FINEST)) {
- logger.finest(String.format("Wrote %s to network. bytes: %d", num, length));
+ logger.finest(String.format("Wrote %s to network. bytes: %d", num, msg.length));
}
- super.writeMessage(msg);
+ super.writeMessage(outgoing);
bytesOut += totalWritten;
-
- // Remember the message may need to be retransmitted.
- delayedExecutor.queue((long) (RETRANSMISSION_PERIOD * this.latency * (1 << attempt)), sent);
}
public int getOutstanding() {
@@ -243,11 +269,13 @@ public long getLatency() {
}
public DirectByteBuffer getMessage(SequenceNumber num) {
- sentMessage m = this.sentMessages.get(num);
- if (m != null) {
- return m.msg;
+ synchronized (sentMessages) {
+ sentMessage m = this.sentMessages.get(num);
+ if (m != null) {
+ return m.msg;
+ }
+ return null;
}
- return null;
}
/**
@@ -258,26 +286,28 @@ public DirectByteBuffer getMessage(SequenceNumber num) {
* @return True if the message was successfully stopped from retransmitting.
*/
public boolean forgetMessage(SequenceNumber num) {
- sentMessage msg = this.sentMessages.remove(num);
- if (msg == null) {
- return false;
- }
- msg.cancel();
- this.outstandingBytes -= msg.length;
- long now = System.currentTimeMillis();
- long sample = now - msg.creation;
- // If not the first attempt, we don't know which attempt was acked.
- if (msg.attempt == 0) {
- this.latency = (long) (this.latency * (1 - EWMA) + sample * EWMA);
- if (sample < minLatency) {
- minLatency = sample;
+ synchronized (sentMessages) {
+ sentMessage msg = this.sentMessages.remove(num);
+ if (msg == null) {
+ return false;
}
+ msg.cancel();
+ this.outstandingBytes -= msg.length;
+ long now = System.currentTimeMillis();
+ long sample = now - msg.creation;
+ // If not the first attempt, we don't know which attempt was acked.
+ if (msg.attempt == 0) {
+ this.latency = (long) (this.latency * (1 - EWMA) + sample * EWMA);
+ if (sample < minLatency) {
+ minLatency = sample;
+ }
- // Pending messages sent before this one were probably lost
- sentMessage[] messages = this.sentMessages.values().toArray(new sentMessage[0]);
- for (sentMessage m : messages) {
- if (m.creation < msg.creation) {
- m.run();
+ // Pending messages sent before this one were potentially lost
+ sentMessage[] messages = this.sentMessages.values().toArray(new sentMessage[0]);
+ for (sentMessage m : messages) {
+ if (m.creation < msg.creation) {
+ m.run();
+ }
}
}
}
@@ -296,11 +326,12 @@ protected boolean isService() {
private final int position;
public long creation;
private final SequenceNumber num;
- private final int attempt;
+ private int attempt;
private final boolean datagram;
+ public final boolean rst;
public sentMessage(SequenceNumber num, ReferenceCountedDirectByteBuffer msg, int length,
- int attempt, boolean datagram) {
+ int attempt, boolean datagram, boolean rst) {
this.creation = System.currentTimeMillis();
this.msg = msg;
this.position = msg.position(ss);
@@ -309,20 +340,27 @@ public sentMessage(SequenceNumber num, ReferenceCountedDirectByteBuffer msg, int
this.num = num;
this.attempt = attempt;
this.datagram = datagram;
+ this.rst = rst;
}
@Override
public void run() {
- sentMessage self = sentMessages.remove(num);
- if (self != null && !closed) {
- if (self.attempt == attempt) {
- logger.fine(num + " was retransmitted.");
- outstandingBytes -= length;
- msg.position(ss, position);
- writeMessage(num, msg, attempt + 1, datagram);
- } else {
+ synchronized (sentMessages) {
+ sentMessage self = sentMessages.remove(num);
+ if (self == null || closed) {
+ return;
+ }
+ if (self.attempt != attempt) {
+ logger.warning("Message queue concurency issues");
sentMessages.put(num, self);
+ return;
}
+
+ this.attempt += 1;
+ logger.fine("retransmitting " + num + ", try " + attempt);
+ outstandingBytes -= length;
+ msg.position(ss, position);
+ writeMessage(this);
}
}
3  oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/ServiceConnection.java
View
@@ -287,8 +287,7 @@ public boolean channelGotMessage(ServiceChannelEndpoint sender, OSF2FServiceData
if (msg.isAck()) {
logger.fine("Acked msg " + msg.getSequenceNumber());
- mmt.onAck(msg);
- windowSize += 1;
+ windowSize += mmt.onAck(msg);
return true;
}
7 oneswarm_f2f/src/edu/washington/cs/oneswarm/f2f/servicesharing/ServiceConnectionManager.java
View
@@ -33,6 +33,8 @@ public static ServiceConnectionManager getInstance() {
return instance;
}
+ // Both are lists are keyed on service key. 1 endpoint per overlay path, 1
+ // serviceconnection per local connection.
private final HashMap<Long, List<ServiceChannelEndpoint>> connections = new HashMap<Long, List<ServiceChannelEndpoint>>();
private final HashMap<Long, List<ServiceConnection>> services = new HashMap<Long, List<ServiceConnection>>();
@@ -51,7 +53,7 @@ public ServiceChannelEndpoint createChannel(FriendConnection nextHop, OSF2FHashS
return channel;
}
- public void addChannel(ServiceChannelEndpoint channel) {
+ private void addChannel(ServiceChannelEndpoint channel) {
logger.fine("Network Channel registered with Connection Manager");
Long key = channel.getServiceKey();
if (!this.connections.containsKey(key)) {
@@ -125,7 +127,8 @@ public boolean channelGotMessage(ServiceChannelEndpoint sender, OSF2FServiceData
} else {
for (ServiceConnection c : existing) {
if (c.subchannelId == msg.getSubchannel()) {
- // Ignore duplicate syn messages.
+ // Ignore duplicate syn messages - the connection will
+ // handle it directly.
return false;
}
}
19 oneswarm_f2f/test/edu/washington/cs/oneswarm/f2f/servicesharing/ClientServiceConnectionTest.java
View
@@ -27,21 +27,17 @@
import edu.washington.cs.oneswarm.f2f.network.FriendConnection;
import edu.washington.cs.oneswarm.f2f.network.QueueManager;
import edu.washington.cs.oneswarm.f2f.network.SearchManager;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ClientServiceConnection;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceChannelEndpoint;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceSharingLoopback;
-import edu.washington.cs.oneswarm.f2f.servicesharing.ServiceSharingManager;
import edu.washington.cs.oneswarm.test.integration.ServiceSharingClientTest;
import edu.washington.cs.oneswarm.test.util.MessageStreamDecoderTestImpl;
import edu.washington.cs.oneswarm.test.util.OneSwarmTestBase;
import edu.washington.cs.oneswarm.test.util.TestUtils;
/**
- * Tests ClientServiceConnection, verifying that data put into its NetworkConnection
- * makes its way to one of its FriendConnections.
+ * Tests ServiceConnections, verifying that data put into its NetworkConnection
+ * makes its way to at least one of the connection endpoints.
*
* @author Krysta
- *
+ *
*/
public class ClientServiceConnectionTest extends OneSwarmTestBase {
@@ -52,7 +48,7 @@
private final static int NUM_FRIENDS = 2;
/* The various layers of data-handling */
- private static ClientServiceConnection clientConn;
+ private static ServiceConnection clientConn;
private static NetworkConnection netConn;
private static List<FriendConnection> friends;
private static MessageStreamDecoderTestImpl decoder;
@@ -108,7 +104,7 @@ private static void setupConnections() {
tcpEndpoint.getConnectionEndpoint(), new OSF2FMessageEncoder(), decoder,
false, false, null);
- clientConn = ClientServiceConnection.getConnectionForTest(netConn);
+ clientConn = new ServiceConnection(true, (short) 0, netConn);
friends = new ArrayList<FriendConnection>();
QueueManager qMgr = new QueueManager();
@@ -116,8 +112,9 @@ private static void setupConnections() {
Friend remoteFriend = new Friend("", "Remote " + i, null, false);
FriendConnection friend = FriendConnection.createStubForTests(qMgr, netConn, remoteFriend);
friends.add(friend);
- clientConn.addChannel(friend, new OSF2FHashSearch((byte) 0, 0, 0),
- new OSF2FHashSearchResp((byte) 0, 0, 0, 0));
+ ServiceChannelEndpoint ep = new ServiceChannelEndpoint(friend, new OSF2FHashSearch(
+ (byte) 0, 0, 0), new OSF2FHashSearchResp((byte) 0, 0, 0, 0), true);
+ clientConn.addChannel(ep);
}
}
21 oneswarm_f2f/test/edu/washington/cs/oneswarm/f2ftest/OsSSLTester.java
View
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
-import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import org.gudy.azureus2.core3.config.COConfigurationManager;
@@ -33,8 +32,6 @@
import org.gudy.azureus2.core3.util.Debug;
import com.aelitis.azureus.core.networkmanager.VirtualChannelSelector;
-import com.aelitis.azureus.core.networkmanager.VirtualServerChannelSelector;
-import com.aelitis.azureus.core.networkmanager.VirtualServerChannelSelectorFactory;
import com.aelitis.azureus.core.networkmanager.VirtualChannelSelector.VirtualSelectorListener;
import com.aelitis.azureus.core.networkmanager.impl.ProtocolDecoder;
import com.aelitis.azureus.core.networkmanager.impl.ProtocolDecoderAdapter;
@@ -49,7 +46,7 @@
private final VirtualChannelSelector connect_selector = new VirtualChannelSelector("PHETester",
VirtualChannelSelector.OP_CONNECT, true);
- private byte[] TEST_HEADER = "TestHeader".getBytes();
+ private final byte[] TEST_HEADER = "TestHeader".getBytes();
private static boolean OUTGOING_PLAIN = false;
@@ -92,6 +89,7 @@ protected void incoming(SocketChannel channel) {
final ProtocolDecoderInitial decoder = new ProtocolDecoderInitial(helper, null, false,
null, new ProtocolDecoderAdapter() {
+ @Override
public void decodeComplete(ProtocolDecoder decoder,
ByteBuffer remaining_initial_data) {
System.out.println("incoming decode complete: "
@@ -102,18 +100,22 @@ public void decodeComplete(ProtocolDecoder decoder,
writeStream("ten fat monkies", decoder.getFilter());
}
+ @Override
public void decodeFailed(ProtocolDecoder decoder, Throwable cause) {
System.out.println("incoming decode failed: "
+ Debug.getNestedExceptionMessage(cause));
}
+ @Override
public void gotSecret(byte[] session_secret) {
}
+ @Override
public int getMaximumPlainHeaderLength() {
return (TEST_HEADER.length);
}
+ @Override
public int matchPlainHeader(ByteBuffer buffer) {
int pos = buffer.position();
int lim = buffer.limit();
@@ -164,6 +166,7 @@ protected void outgoing() {
} else {
connect_selector.register(channel, new VirtualSelectorListener() {
+ @Override
public boolean selectSuccess(VirtualChannelSelector selector, SocketChannel sc,
Object attachment) {
try {
@@ -184,6 +187,7 @@ public boolean selectSuccess(VirtualChannelSelector selector, SocketChannel sc,
}
}
+ @Override
public void selectFailure(VirtualChannelSelector selector, SocketChannel sc,
Object attachment, Throwable msg) {
msg.printStackTrace();
@@ -211,6 +215,7 @@ protected void outgoing(SocketChannel channel) {
final ProtocolDecoderInitial decoder = new ProtocolDecoderInitial(helper,
new byte[][] { shared_secret }, true, null, new ProtocolDecoderAdapter() {
+ @Override
public void decodeComplete(ProtocolDecoder decoder,
ByteBuffer remaining_initial_data) {
System.out.println("outgoing decode complete: "
@@ -223,19 +228,23 @@ public void decodeComplete(ProtocolDecoder decoder,
writeStream("two jolly porkers", decoder.getFilter());
}
+ @Override
public void decodeFailed(ProtocolDecoder decoder, Throwable cause) {
System.out.println("outgoing decode failed: "
+ Debug.getNestedExceptionMessage(cause));
}
+ @Override
public void gotSecret(byte[] session_secret) {
}
+ @Override
public int getMaximumPlainHeaderLength() {
throw (new RuntimeException());
}
+ @Override
public int matchPlainHeader(ByteBuffer buffer) {
throw (new RuntimeException());
}
@@ -254,6 +263,7 @@ protected void readStream(final String str, final TransportHelperFilter filter)
.getReadSelector()
.register(((TCPTransportHelper) filter.getHelper()).getSocketChannel(),
new VirtualSelectorListener() {
+ @Override
public boolean selectSuccess(VirtualChannelSelector selector,
SocketChannel sc, Object attachment) {
ByteBuffer buffer = ByteBuffer.allocate(1024);
@@ -279,6 +289,7 @@ public boolean selectSuccess(VirtualChannelSelector selector,
}
}
+ @Override
public void selectFailure(VirtualChannelSelector selector,
SocketChannel sc, Object attachment, Throwable msg) {
msg.printStackTrace();
@@ -317,7 +328,7 @@ protected void writeStream(byte[] data, SocketChannel channel) {
public static void main(String[] args) {
// String[] encrProto = { "Plain", "XOR", "RC4", "AES", "SSL" };
- AEDiagnostics.startup();
+ AEDiagnostics.startup(true);
// OUTGOING_PLAIN = true;
14 oneswarm_gwt_ui/src/edu/washington/cs/oneswarm/ui/gwt/client/ReportableErrorDialogBox.java
View
@@ -1,13 +1,13 @@
package edu.washington.cs.oneswarm.ui.gwt.client;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
import edu.washington.cs.oneswarm.ui.gwt.client.i18n.OSMessages;
import edu.washington.cs.oneswarm.ui.gwt.rpc.OneSwarmException;
@@ -78,8 +78,9 @@ public ReportableErrorDialogBox(final String inErrorString, boolean fatal,
status_and_button.setCellHorizontalAlignment(statusLabel, HorizontalPanel.ALIGN_LEFT);
mainPanel.add(status_and_button);
- dismissButton.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
+ dismissButton.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
// statusLabel.setText("Sending report...");
// ((Button)sender).setEnabled(false);
//
@@ -98,9 +99,8 @@ public void onClick(Widget sender) {
// onFailure(null);
// }
hide();
- // }); // reportError RPC
- } // report button onClick()
- }); // add click listener
+ }
+ });
setWidget(mainPanel);
Please sign in to comment.
Something went wrong with that request. Please try again.