Files
briar/briar-api/src/org/briarproject/api/plugins/duplex/DuplexPlugin.java
akwizgran d4fa656dbb Application layer keepalives to detect dead TCP connections.
DuplexOutgoingSession flushes its output stream if it's idle for a
transport-defined interval, causing an empty frame to be sent. The TCP
and Tor plugins use a socket timeout equal to twice the idle interval to
detect dead connections.

See bugs #27, #46 and #60.
2014-12-13 12:00:40 +00:00

31 lines
1010 B
Java

package org.briarproject.api.plugins.duplex;
import org.briarproject.api.ContactId;
import org.briarproject.api.crypto.PseudoRandom;
import org.briarproject.api.plugins.Plugin;
/** An interface for transport plugins that support duplex communication. */
public interface DuplexPlugin extends Plugin {
/** Returns the transport's maximum idle time in milliseconds. */
long getMaxIdleTime();
/**
* Attempts to create and return a connection to the given contact using
* the current transport and configuration properties. Returns null if a
* connection could not be created.
*/
DuplexTransportConnection createConnection(ContactId c);
/** Returns true if the plugin supports exchanging invitations. */
boolean supportsInvitations();
/**
* Attempts to create and return an invitation connection to the remote
* peer. Returns null if no connection can be established within the given
* time.
*/
DuplexTransportConnection createInvitationConnection(PseudoRandom r,
long timeout);
}