mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Retransmit messages based on maximum latency of transport.
This commit is contained in:
@@ -80,23 +80,25 @@ public interface DatabaseComponent {
|
||||
|
||||
/**
|
||||
* Generates a batch of raw messages for the given contact, with a total
|
||||
* length less than or equal to the given length. Returns null if
|
||||
* there are no sendable messages that fit in the given length.
|
||||
* length less than or equal to the given length, for transmission over a
|
||||
* transport with the given maximum latency. Returns null if there are no
|
||||
* sendable messages that fit in the given length.
|
||||
*/
|
||||
Collection<byte[]> generateBatch(ContactId c, int maxLength)
|
||||
throws DbException;
|
||||
Collection<byte[]> generateBatch(ContactId c, int maxLength,
|
||||
long maxLatency) throws DbException;
|
||||
|
||||
/**
|
||||
* Generates a batch of raw messages for the given contact from the given
|
||||
* collection of requested messages, with a total length less than or equal
|
||||
* to the given length. Any messages that were either added to the batch,
|
||||
* or were considered but are no longer sendable to the contact, are
|
||||
* removed from the collection of requested messages before returning.
|
||||
* Returns null if there are no sendable messages that fit in the given
|
||||
* length.
|
||||
* to the given length, for transmission over a transport with the given
|
||||
* maximum latency. Any messages that were either added to the batch, or
|
||||
* were considered but are no longer sendable to the contact, are removed
|
||||
* from the collection of requested messages before returning. Returns null
|
||||
* if there are no sendable messages that fit in the given length.
|
||||
*/
|
||||
Collection<byte[]> generateBatch(ContactId c, int maxLength,
|
||||
Collection<MessageId> requested) throws DbException;
|
||||
long maxLatency, Collection<MessageId> requested)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Generates an offer for the given contact. Returns null if there are no
|
||||
|
||||
@@ -11,6 +11,9 @@ import java.io.OutputStream;
|
||||
*/
|
||||
public interface DuplexTransportConnection {
|
||||
|
||||
/** Returns the maximum latency of the transport in milliseconds. */
|
||||
long getMaxLatency();
|
||||
|
||||
/** Returns an input stream for reading from the connection. */
|
||||
InputStream getInputStream() throws IOException;
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ public interface SimplexTransportWriter {
|
||||
/** Returns the capacity of the transport in bytes. */
|
||||
long getCapacity();
|
||||
|
||||
/** Returns the maximum latency of the transport in milliseconds. */
|
||||
long getMaxLatency();
|
||||
|
||||
/** Returns an output stream for writing to the transport. */
|
||||
OutputStream getOutputStream() throws IOException;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user