Skip to content

Commit

Permalink
ready for integration in a better ASAPAndroid release.
Browse files Browse the repository at this point in the history
  • Loading branch information
thsc42 committed Jan 15, 2021
1 parent 9734d0b commit 2f77de2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.sharksystem.asap.internals;
package net.sharksystem.asap;

import net.sharksystem.asap.ASAPException;
import net.sharksystem.asap.protocol.ASAPConnection;
Expand Down
5 changes: 3 additions & 2 deletions src/net/sharksystem/asap/ASAPInternalPeerWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.sharksystem.asap.internals.ASAPInternalOnlinePeersChangedListener;
import net.sharksystem.asap.internals.ASAPInternalPeer;
import net.sharksystem.asap.protocol.ASAPConnection;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -29,8 +30,8 @@ public CharSequence getPeerName() {
return this.peer.getOwner();
}

public void handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
this.peer.handleConnection(is, os);
public ASAPConnection handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
return this.peer.handleConnection(is, os);
}

@Override
Expand Down
7 changes: 3 additions & 4 deletions src/net/sharksystem/asap/ASAPPeerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import java.io.InputStream;
import java.io.OutputStream;

public interface ASAPPeerService extends ASAPPeer {
long DEFAULT_MAX_PROCESSING_TIME = ASAPInternalPeer.DEFAULT_MAX_PROCESSING_TIME;

void handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException;
public interface ASAPPeerService extends ASAPPeer, ASAPConnectionHandler {
// long DEFAULT_MAX_PROCESSING_TIME = 30000; // 30 seconds
long DEFAULT_MAX_PROCESSING_TIME = Long.MAX_VALUE; // eternity - debugging setting

/**
* Overwrite internal listener. This method is used e.g. in Androiud on service side. The asap peer is informed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.sharksystem.asap.internals.ASAPChunkReceivedListener;
import net.sharksystem.asap.ASAPException;
import net.sharksystem.asap.internals.ASAPMessages;
import net.sharksystem.asap.protocol.ASAPConnection;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -125,7 +126,7 @@ public CharSequence getPeerName() {
}

@Override
public void handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
public ASAPConnection handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
throw new ASAPException("that's a mock, no real peer");
}

Expand Down
1 change: 1 addition & 0 deletions src/net/sharksystem/asap/internals/ASAPInternalPeer.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.sharksystem.asap.internals;

import net.sharksystem.asap.ASAPConnectionHandler;
import net.sharksystem.asap.ASAPException;
import net.sharksystem.asap.ASAPSecurityException;
import net.sharksystem.asap.protocol.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.io.InputStream;
import java.io.OutputStream;

import net.sharksystem.asap.internals.ASAPConnectionHandler;
import net.sharksystem.asap.ASAPConnectionHandler;
import net.sharksystem.asap.ASAPException;

/**
Expand Down

0 comments on commit 2f77de2

Please sign in to comment.