diff --git a/.DS_Store b/.DS_Store index 895a49c3..ff02c02b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/ws2012/CE/Folien/gms-05-NAE-col.pdf b/ws2012/CE/Folien/gms-05-NAE-col.pdf new file mode 100644 index 00000000..735577e1 Binary files /dev/null and b/ws2012/CE/Folien/gms-05-NAE-col.pdf differ diff --git a/ws2012/CE/uebungen/4/EiCE_Uebung04.pdf b/ws2012/CE/uebungen/4/EiCE_Uebung04.pdf new file mode 100644 index 00000000..bc1c0259 Binary files /dev/null and b/ws2012/CE/uebungen/4/EiCE_Uebung04.pdf differ diff --git a/ws2012/P2P/Folien/Lecture_2.pdf b/ws2012/P2P/Folien/Lecture_2.pdf new file mode 100644 index 00000000..7bacd48a Binary files /dev/null and b/ws2012/P2P/Folien/Lecture_2.pdf differ diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/client/BufferedNetworkStackClient.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/client/BufferedNetworkStackClient.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/client/ClientGUI.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/client/ClientGUI.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/client/TimeoutException.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/client/TimeoutException.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/common/MessageType.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/common/MessageType.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/common/Util.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/common/Util.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/server/BufferedNetworkStack.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/server/BufferedNetworkStack.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/server/Element.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/2/p2p_ex2/src/tests/BufferedNetworkStackTests.java b/ws2012/P2P/uebungen/2/p2p_ex2/src/tests/BufferedNetworkStackTests.java old mode 100644 new mode 100755 diff --git a/ws2012/P2P/uebungen/3/exercise3_01.pdf b/ws2012/P2P/uebungen/3/exercise3_01.pdf new file mode 100644 index 00000000..d0faba04 Binary files /dev/null and b/ws2012/P2P/uebungen/3/exercise3_01.pdf differ diff --git a/ws2012/P2P/uebungen/3/exercise3_solution.odt b/ws2012/P2P/uebungen/3/exercise3_solution.odt index c2634291..26e0d7e0 100644 Binary files a/ws2012/P2P/uebungen/3/exercise3_solution.odt and b/ws2012/P2P/uebungen/3/exercise3_solution.odt differ diff --git a/ws2012/P2P/uebungen/3/exercise3_solution.pdf b/ws2012/P2P/uebungen/3/exercise3_solution.pdf index cd40e7ba..15d31448 100644 Binary files a/ws2012/P2P/uebungen/3/exercise3_solution.pdf and b/ws2012/P2P/uebungen/3/exercise3_solution.pdf differ diff --git a/ws2012/P2P/uebungen/4/src/network/Network.java b/ws2012/P2P/uebungen/4/src/network/Network.java new file mode 100644 index 00000000..1bf6a823 --- /dev/null +++ b/ws2012/P2P/uebungen/4/src/network/Network.java @@ -0,0 +1,13 @@ +package network; + +public class Network { + + + //grow a network: Starting with one peer, repeatedly let peers spawn or leave at random + public static void main(String[] args) { + + } + + + +} diff --git a/ws2012/P2P/uebungen/4/src/peer/Node.java b/ws2012/P2P/uebungen/4/src/peer/Node.java new file mode 100644 index 00000000..dfe72755 --- /dev/null +++ b/ws2012/P2P/uebungen/4/src/peer/Node.java @@ -0,0 +1,50 @@ +package peer; + +import java.util.Iterator; +import java.util.List; + +public class Node { + + private int id; // node id must be unique! id = IP of peer ?!? + //-> Should be unique if we don't consider peers behind a NAT. + + private List neighbours; + + public Node(int id, List neighbours){ + this.id = id; + this.neighbours = neighbours; + } + + + //add one single neighbour + public void addSingleNeighbour(Node neighbour){ + this.neighbours.add(neighbour); + } + + //add a list of new neighbours + public void addMultiNeighbours(List neighbours){ + Iterator it = neighbours.iterator(); + while(it.hasNext()){ + this.neighbours.add(it.next()); + } + } + + public boolean hasNeighbours(){ + return (this.neighbours.size() > 0); + } + + //checks if actual node has neighbour with given id + public boolean hasNeighbour(int id){ + for(int i = 0; i < neighbours.size(); i++){ + Node tmp = neighbours.get(i); + if(tmp.id == id){ + return true; + } + } + return false; + } + + + + +} diff --git a/ws2012/P2P/uebungen/4/src/peer/Peer.java b/ws2012/P2P/uebungen/4/src/peer/Peer.java new file mode 100644 index 00000000..c0f14dc6 --- /dev/null +++ b/ws2012/P2P/uebungen/4/src/peer/Peer.java @@ -0,0 +1,31 @@ +package peer; + + +public class Peer { + + private Node node; + + + //create another peer, mutually link creator and spawn + public void spawn(){ + + } + + + + //circularly link all neighbours, remove itself form all neighbours and exit + public void leave(){ + + } + + + + + + + + + + + +} diff --git a/ws2012/P2P/uebungen/4/u2.pdf b/ws2012/P2P/uebungen/4/u2.pdf new file mode 100644 index 00000000..0c21145d Binary files /dev/null and b/ws2012/P2P/uebungen/4/u2.pdf differ