Skip to content

Commit 2f77de2

Browse files
committed
ready for integration in a better ASAPAndroid release.
1 parent 9734d0b commit 2f77de2

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

src/net/sharksystem/asap/internals/ASAPConnectionHandler.java renamed to src/net/sharksystem/asap/ASAPConnectionHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.sharksystem.asap.internals;
1+
package net.sharksystem.asap;
22

33
import net.sharksystem.asap.ASAPException;
44
import net.sharksystem.asap.protocol.ASAPConnection;

src/net/sharksystem/asap/ASAPInternalPeerWrapper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import net.sharksystem.asap.internals.ASAPInternalOnlinePeersChangedListener;
44
import net.sharksystem.asap.internals.ASAPInternalPeer;
5+
import net.sharksystem.asap.protocol.ASAPConnection;
56

67
import java.io.IOException;
78
import java.io.InputStream;
@@ -29,8 +30,8 @@ public CharSequence getPeerName() {
2930
return this.peer.getOwner();
3031
}
3132

32-
public void handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
33-
this.peer.handleConnection(is, os);
33+
public ASAPConnection handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
34+
return this.peer.handleConnection(is, os);
3435
}
3536

3637
@Override

src/net/sharksystem/asap/ASAPPeerService.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
import java.io.InputStream;
88
import java.io.OutputStream;
99

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

1514
/**
1615
* Overwrite internal listener. This method is used e.g. in Androiud on service side. The asap peer is informed

src/net/sharksystem/asap/apps/testsupport/ASAPPeerWrapperMock.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import net.sharksystem.asap.internals.ASAPChunkReceivedListener;
77
import net.sharksystem.asap.ASAPException;
88
import net.sharksystem.asap.internals.ASAPMessages;
9+
import net.sharksystem.asap.protocol.ASAPConnection;
910

1011
import java.io.IOException;
1112
import java.io.InputStream;
@@ -125,7 +126,7 @@ public CharSequence getPeerName() {
125126
}
126127

127128
@Override
128-
public void handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
129+
public ASAPConnection handleConnection(InputStream is, OutputStream os) throws IOException, ASAPException {
129130
throw new ASAPException("that's a mock, no real peer");
130131
}
131132

src/net/sharksystem/asap/internals/ASAPInternalPeer.java

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.sharksystem.asap.internals;
22

3+
import net.sharksystem.asap.ASAPConnectionHandler;
34
import net.sharksystem.asap.ASAPException;
45
import net.sharksystem.asap.ASAPSecurityException;
56
import net.sharksystem.asap.protocol.*;

src/net/sharksystem/asap/util/ASAPPeerHandleConnectionThread.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.io.InputStream;
55
import java.io.OutputStream;
66

7-
import net.sharksystem.asap.internals.ASAPConnectionHandler;
7+
import net.sharksystem.asap.ASAPConnectionHandler;
88
import net.sharksystem.asap.ASAPException;
99

1010
/**

0 commit comments

Comments
 (0)