Merge branch 'aggressive-polling' into 'master'

Try harder to connect to contacts

* When an outgoing connection is lost, try to reconnect to the contact straight away
* Use periodic polling for Tor, regardless of whether our hidden service descriptor has been published
* Reduce polling intervals for all plugins (this can be reverted if we solve the connectivity issues)

Closes #262, #314. Hopefully helps with #361.

See merge request !177
This commit is contained in:
akwizgran
2016-05-10 14:47:04 +00:00
18 changed files with 230 additions and 127 deletions

View File

@@ -0,0 +1,30 @@
package org.briarproject.api.event;
import org.briarproject.api.TransportId;
import org.briarproject.api.contact.ContactId;
public class ConnectionClosedEvent extends Event {
private final ContactId contactId;
private final TransportId transportId;
private final boolean incoming;
public ConnectionClosedEvent(ContactId contactId, TransportId transportId,
boolean incoming) {
this.contactId = contactId;
this.transportId = transportId;
this.incoming = incoming;
}
public ContactId getContactId() {
return contactId;
}
public TransportId getTransportId() {
return transportId;
}
public boolean isIncoming() {
return incoming;
}
}

View File

@@ -0,0 +1,30 @@
package org.briarproject.api.event;
import org.briarproject.api.TransportId;
import org.briarproject.api.contact.ContactId;
public class ConnectionOpenedEvent extends Event {
private final ContactId contactId;
private final TransportId transportId;
private final boolean incoming;
public ConnectionOpenedEvent(ContactId contactId, TransportId transportId,
boolean incoming) {
this.contactId = contactId;
this.transportId = transportId;
this.incoming = incoming;
}
public ContactId getContactId() {
return contactId;
}
public TransportId getTransportId() {
return transportId;
}
public boolean isIncoming() {
return incoming;
}
}

View File

@@ -10,9 +10,9 @@ import java.util.Collection;
*/
public interface ConnectionRegistry {
void registerConnection(ContactId c, TransportId t);
void registerConnection(ContactId c, TransportId t, boolean incoming);
void unregisterConnection(ContactId c, TransportId t);
void unregisterConnection(ContactId c, TransportId t, boolean incoming);
Collection<ContactId> getConnectedContacts(TransportId t);