Skip to content

Commit 14b7329

Browse files
committed
extracted extra data management from internal peer to net.sharksystem.utils.ExtraData
1 parent 3f820a3 commit 14b7329

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import net.sharksystem.asap.ASAPPeerFS;
44
import net.sharksystem.asap.ASAPException;
5+
import net.sharksystem.asap.EncounterConnectionType;
56

67
import java.io.IOException;
78
import java.net.ServerSocket;
@@ -63,7 +64,8 @@ public void run() {
6364
try {
6465
ASAPTestPeerFS.this.handleConnection(
6566
ASAPTestPeerFS.this.socket.getInputStream(),
66-
ASAPTestPeerFS.this.socket.getOutputStream());
67+
ASAPTestPeerFS.this.socket.getOutputStream(),
68+
EncounterConnectionType.INTERNET);
6769
} catch (IOException | ASAPException e) {
6870
ASAPTestPeerFS.this.log("fatal while connecting: " + e.getLocalizedMessage());
6971
}

src/net/sharksystem/asap/engine/ASAPInternalPeerFS.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -693,24 +693,6 @@ private ExtraData getExtraData() throws SharkException, IOException {
693693

694694
return this.extraData;
695695
}
696-
/*
697-
private static final String EXTRA_FILE_NAME = ".extraData";
698-
private Map<CharSequence, byte[]> extraData = new HashMap<>();
699-
700-
private File getExtraFile() {
701-
String extraFileName = this.rootFolderName + "/" + EXTRA_FILE_NAME;
702-
return new File(extraFileName);
703-
}
704-
*/
705-
706-
/*
707-
Here is the catch... There can be - and in Android will - two instances share data over file system. The use
708-
same clock but run in different threads, most likely different processes. We have to synchronize both sides.
709-
710-
There will be two processes A and B. Let's assume we are in process A.
711-
a) We never written something,
712-
713-
*/
714696

715697
public void putExtra(CharSequence key, byte[] value) throws IOException, SharkException {
716698
this.getExtraData().putExtra(key, value);

0 commit comments

Comments
 (0)