Allow the max packet length to be reduced from the default.

This commit is contained in:
akwizgran
2011-09-21 13:47:06 +01:00
parent 77d61e0aea
commit 7e58b25618
7 changed files with 108 additions and 17 deletions

View File

@@ -7,6 +7,12 @@ import net.sf.briar.api.protocol.BatchId;
/** An interface for creating an ack packet. */
public interface AckWriter {
/**
* Sets the maximum length of the serialised ack. If this method is not
* called, the default is ProtocolConstants.MAX_PACKET_LENGTH;
*/
void setMaxPacketLength(int length);
/**
* Attempts to add the given BatchId to the ack and returns true if it
* was added.

View File

@@ -7,6 +7,12 @@ import net.sf.briar.api.protocol.BatchId;
/** An interface for creating a batch packet. */
public interface BatchWriter {
/**
* Sets the maximum length of the serialised batch. If this method is not
* called, the default is ProtocolConstants.MAX_PACKET_LENGTH;
*/
void setMaxPacketLength(int length);
/**
* Attempts to add the given raw message to the batch and returns true if
* it was added.

View File

@@ -7,6 +7,12 @@ import net.sf.briar.api.protocol.MessageId;
/** An interface for creating an offer packet. */
public interface OfferWriter {
/**
* Sets the maximum length of the serialised offer. If this method is not
* called, the default is ProtocolConstants.MAX_PACKET_LENGTH;
*/
void setMaxPacketLength(int length);
/**
* Attempts to add the given message ID to the offer and returns true if it
* was added.