mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Let the plugin determine whether to flush the output stream after each
packet.
This commit is contained in:
@@ -28,9 +28,8 @@ public interface Plugin {
|
||||
long getPollingInterval();
|
||||
|
||||
/**
|
||||
* Attempts to establish connections using the current transport and
|
||||
* configuration properties, and passes any created connections to the
|
||||
* callback.
|
||||
* Attempts to establish connections to all contacts, passing any created
|
||||
* connections to the callback.
|
||||
*/
|
||||
void poll();
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.io.IOException;
|
||||
|
||||
public interface ProtocolWriter {
|
||||
|
||||
void flush() throws IOException;
|
||||
|
||||
int getMaxBatchesForAck(long capacity);
|
||||
|
||||
int getMaxMessagesForOffer(long capacity);
|
||||
|
||||
@@ -4,5 +4,5 @@ import java.io.OutputStream;
|
||||
|
||||
public interface ProtocolWriterFactory {
|
||||
|
||||
ProtocolWriter createProtocolWriter(OutputStream out);
|
||||
ProtocolWriter createProtocolWriter(OutputStream out, boolean flush);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,11 @@ public interface BatchTransportWriter {
|
||||
/** Returns an output stream for writing to the transport. */
|
||||
OutputStream getOutputStream();
|
||||
|
||||
/**
|
||||
* Returns true if the output stream should be flushed after each packet.
|
||||
*/
|
||||
boolean shouldFlush();
|
||||
|
||||
/**
|
||||
* Closes the writer and disposes of any associated resources. The
|
||||
* argument indicates whether the writer is being closed because of an
|
||||
|
||||
@@ -17,6 +17,11 @@ public interface StreamTransportConnection {
|
||||
/** Returns an output stream for writing to the connection. */
|
||||
OutputStream getOutputStream() throws IOException;
|
||||
|
||||
/**
|
||||
* Returns true if the output stream should be flushed after each packet.
|
||||
*/
|
||||
boolean shouldFlush();
|
||||
|
||||
/**
|
||||
* Closes the connection and disposes of any associated resources. The
|
||||
* first argument indicates whether the connection is being closed because
|
||||
|
||||
Reference in New Issue
Block a user