Made the invitation protocol symmetrical.

Both devices try to make outgoing connections and accept incoming
connections simultaneously. This should lead to faster connection
establishment when there are asymmetrical connectivity problems, such as
devices that are unable to receive LAN multicast packets or make
themselves discoverable via Bluetooth.
This commit is contained in:
akwizgran
2013-06-13 12:53:44 +01:00
parent bebaf4f84b
commit e1ec17f4b6
13 changed files with 52 additions and 161 deletions

View File

@@ -18,14 +18,10 @@ public interface DuplexPlugin extends Plugin {
boolean supportsInvitations();
/**
* Starts the invitation process from the inviter's side. Returns null if
* no connection can be established within the given timeout.
* 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 sendInvitation(PseudoRandom r, long timeout);
/**
* Starts the invitation process from the invitee's side. Returns null if
* no connection can be established within the given timeout.
*/
DuplexTransportConnection acceptInvitation(PseudoRandom r, long timeout);
DuplexTransportConnection createInvitationConnection(PseudoRandom r,
long timeout);
}