Allow for the maximum overhead when calculating capacity.

This commit is contained in:
akwizgran
2012-08-28 14:22:29 +01:00
parent 521ed076ca
commit a104548f7c
5 changed files with 37 additions and 36 deletions

View File

@@ -1,19 +1,18 @@
package net.sf.briar.api.protocol;
import net.sf.briar.api.transport.TransportConstants;
import static net.sf.briar.api.transport.TransportConstants.MIN_CONNECTION_LENGTH;
public interface ProtocolConstants {
/**
* The maximum length of a serialised packet in bytes. To allow for future
* changes in the protocol, this is smaller than the minimum connection
* length minus the encryption and authentication overhead.
* length minus the maximum encryption and authentication overhead.
*/
static final int MAX_PACKET_LENGTH =
TransportConstants.MIN_CONNECTION_LENGTH - 1024;
static final int MAX_PACKET_LENGTH = MIN_CONNECTION_LENGTH / 2;
/** The maximum number of transports a node may support. */
static final int MAX_TRANSPORTS = 50;
static final int MAX_TRANSPORTS = 25;
/** The maximum number of properties per transport. */
static final int MAX_PROPERTIES_PER_TRANSPORT = 100;