Allow plugins to use different maximum frame lengths.

This commit is contained in:
akwizgran
2013-06-05 14:16:44 +01:00
parent 90c323e82b
commit 08b11412fb
51 changed files with 298 additions and 159 deletions

View File

@@ -14,6 +14,9 @@ public interface Plugin {
/** Returns a label for looking up the plugin's translated name. */
String getName();
/** Returns the transport's maximum frame length in bytes. */
int getMaxFrameLength();
/** Returns the transport's maximum latency in milliseconds. */
long getMaxLatency();

View File

@@ -11,6 +11,9 @@ import java.io.OutputStream;
*/
public interface DuplexTransportConnection {
/** Returns the maximum frame length of the transport in bytes. */
int getMaxFrameLength();
/** Returns the maximum latency of the transport in milliseconds. */
long getMaxLatency();

View File

@@ -9,6 +9,9 @@ import java.io.InputStream;
*/
public interface SimplexTransportReader {
/** Returns the maximum frame length of the transport in bytes. */
int getMaxFrameLength();
/** Returns an input stream for reading from the transport. */
InputStream getInputStream() throws IOException;

View File

@@ -12,6 +12,9 @@ public interface SimplexTransportWriter {
/** Returns the capacity of the transport in bytes. */
long getCapacity();
/** Returns the maximum frame length of the transport in bytes. */
int getMaxFrameLength();
/** Returns the maximum latency of the transport in milliseconds. */
long getMaxLatency();

View File

@@ -5,10 +5,10 @@ import java.io.InputStream;
public interface ConnectionReaderFactory {
/** Creates a connection reader for one side of a connection. */
ConnectionReader createConnectionReader(InputStream in,
ConnectionReader createConnectionReader(InputStream in, int maxFrameLength,
ConnectionContext ctx, boolean incoming, boolean initiator);
/** Creates a connection reader for one side of an invitation connection. */
ConnectionReader createInvitationConnectionReader(InputStream in,
byte[] secret, boolean alice);
int maxFrameLength, byte[] secret, boolean alice);
}

View File

@@ -5,10 +5,11 @@ import java.io.OutputStream;
public interface ConnectionWriterFactory {
/** Creates a connection writer for one side of a connection. */
ConnectionWriter createConnectionWriter(OutputStream out, long capacity,
ConnectionContext ctx, boolean incoming, boolean initiator);
ConnectionWriter createConnectionWriter(OutputStream out,
int maxFrameLength, long capacity, ConnectionContext ctx,
boolean incoming, boolean initiator);
/** Creates a connection writer for one side of an invitation connection. */
ConnectionWriter createInvitationConnectionWriter(OutputStream out,
byte[] secret, boolean alice);
int maxFrameLength, byte[] secret, boolean alice);
}