Added ListenThread stub
This commit is contained in:
parent
dac5fe1615
commit
a7043d1522
@ -25,16 +25,9 @@ public class Network {
|
||||
|
||||
Peer a = new Peer("A");
|
||||
|
||||
// System.out.println("Spawn B:");
|
||||
a.spawn("B");
|
||||
|
||||
// System.out.println("Spawn C:");
|
||||
a.spawn("C");
|
||||
|
||||
// System.out.println("Spawn D:");
|
||||
a.spawn("D");
|
||||
|
||||
// System.out.println("Leave A:");
|
||||
a.leave();
|
||||
}
|
||||
|
||||
|
||||
@ -104,6 +104,14 @@ public class Node {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Wenn die richtig implementiert ist, ist die
|
||||
* {@link #removeNeighbour(Node) removeNeighbour} ein Einzeiler.
|
||||
*/
|
||||
public boolean equals(Object o) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void printInfos() {
|
||||
StringBuilder result = new StringBuilder(128);
|
||||
result.append("Name: " + this.name + ", Neighbours: ");
|
||||
|
||||
@ -22,7 +22,7 @@ public class Peer {
|
||||
* Create another peer, mutually link creator and spawn.
|
||||
*/
|
||||
public void spawn(String name) {
|
||||
LOGGER.info("Spawning " + name);
|
||||
LOGGER.info("Name: " + node.getName() + ", Spawning " + name);
|
||||
|
||||
// create a new node
|
||||
Node spawnNode = new Node(new Random().nextInt(), name);
|
||||
@ -37,7 +37,7 @@ public class Peer {
|
||||
* exit.
|
||||
*/
|
||||
public void leave() {
|
||||
LOGGER.info("Leaving..." + node.getName());
|
||||
LOGGER.info("Name: " + node.getName() + ", Leaving...");
|
||||
|
||||
List<Node> neighbours = this.node.getNeighbours();
|
||||
|
||||
|
||||
12
ws2012/P2P/uebungen/4/src/peer/UDPListen.java
Normal file
12
ws2012/P2P/uebungen/4/src/peer/UDPListen.java
Normal file
@ -0,0 +1,12 @@
|
||||
package peer;
|
||||
|
||||
public class UDPListen extends Thread {
|
||||
|
||||
public UDPListen(int port) {
|
||||
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user