mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
New retransmission mechanism, which does away with the need for bundle IDs and should cope better with high bandwidth-delay product links.
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Type-safe wrapper for a byte array that uniquely identifies a bundle of
|
||||
* acknowledgements, subscriptions, and batches of messages.
|
||||
*/
|
||||
public class BundleId extends UniqueId {
|
||||
|
||||
public static final BundleId NONE = new BundleId(new byte[] {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
});
|
||||
|
||||
public BundleId(byte[] id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if(o instanceof BundleId)
|
||||
return Arrays.equals(id, ((BundleId) o).id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ public interface BundleWriter {
|
||||
/** Returns the bundle's remaining capacity in bytes. */
|
||||
long getRemainingCapacity() throws IOException;
|
||||
|
||||
/** Adds a header to the bundle and returns its identifier. */
|
||||
BundleId addHeader(Iterable<BatchId> acks, Iterable<GroupId> subs,
|
||||
/** Adds a header to the bundle. */
|
||||
void addHeader(Iterable<BatchId> acks, Iterable<GroupId> subs,
|
||||
Map<String, String> transports) throws IOException,
|
||||
GeneralSecurityException;
|
||||
|
||||
|
||||
@@ -8,9 +8,6 @@ public interface Header {
|
||||
|
||||
static final int MAX_SIZE = 1024 * 1024;
|
||||
|
||||
// FIXME: Remove BundleId when refactoring is complete
|
||||
BundleId getId();
|
||||
|
||||
/** Returns the acknowledgements contained in the header. */
|
||||
Set<BatchId> getAcks();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user