Remove obsolete debug messages
This commit is contained in:
@@ -82,10 +82,8 @@ public abstract class TcpClient extends Work implements Sender {
|
|||||||
|
|
||||||
public final void work() {
|
public final void work() {
|
||||||
try {
|
try {
|
||||||
System.out.println("Client: Waiting for select... ");
|
logger.debug("Client: Waiting for select... ");
|
||||||
System.out.println("Client: Number of selected keys: " + selector.select());
|
logger.debug("Client: Number of selected keys: " + selector.select());
|
||||||
System.out.println("wakker");
|
|
||||||
//selector.select();
|
|
||||||
Set<SelectionKey> selectionKeySet = selector.selectedKeys();
|
Set<SelectionKey> selectionKeySet = selector.selectedKeys();
|
||||||
Iterator<SelectionKey> selectionKeyIterator = selectionKeySet.iterator();
|
Iterator<SelectionKey> selectionKeyIterator = selectionKeySet.iterator();
|
||||||
|
|
||||||
|
|||||||
@@ -34,12 +34,9 @@ public class TcpServerClient extends Listen<byte[]> implements Sender {
|
|||||||
public void readable() throws IOException {
|
public void readable() throws IOException {
|
||||||
int read;
|
int read;
|
||||||
while (( read = socketChannel.read(byteBuffer)) > 0) {
|
while (( read = socketChannel.read(byteBuffer)) > 0) {
|
||||||
//byteBuffer.flip();
|
byteBuffer.flip();
|
||||||
byte[] buffer = byteBuffer.array();
|
byte[] buffer = byteBuffer.array();
|
||||||
input(buffer);
|
input(buffer);
|
||||||
System.out.println("readable() " + new String(buffer).trim());
|
|
||||||
byteBuffer.clear();
|
|
||||||
byteBuffer.put(new byte[bufferSize]);
|
|
||||||
byteBuffer.clear();
|
byteBuffer.clear();
|
||||||
}
|
}
|
||||||
if (read < 0) {
|
if (read < 0) {
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public abstract class UdpMulticastClient extends Work {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
System.out.println("client close socket");
|
|
||||||
socket.close();
|
socket.close();
|
||||||
super.stop();
|
super.stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ public class UdpMulticastServer extends Listen<byte[]> implements Sender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void deactivate() throws DeactivateException {
|
public void deactivate() throws DeactivateException {
|
||||||
System.err.println("lets work the magic");
|
|
||||||
|
|
||||||
socket.close();
|
socket.close();
|
||||||
super.deactivate();
|
super.deactivate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,20 +30,15 @@ public abstract class Worker {
|
|||||||
|
|
||||||
public boolean active() {
|
public boolean active() {
|
||||||
logger.debug("Worker: active()");
|
logger.debug("Worker: active()");
|
||||||
System.out.println(activate + " " + deactivate + " " + active + ": " + (deactivate || active));
|
|
||||||
return deactivate || active;
|
return deactivate || active;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void run() {
|
public final void run() {
|
||||||
logger.debug("Worker: run()");
|
logger.debug("Worker: run()");
|
||||||
while (run || deactivate) {
|
while (run || deactivate) {
|
||||||
System.err.println("xxx");
|
|
||||||
runActivate();
|
runActivate();
|
||||||
System.err.println("act");
|
|
||||||
runDeactivate();
|
runDeactivate();
|
||||||
System.err.println("deact");
|
|
||||||
runWork();
|
runWork();
|
||||||
System.err.println("---" + getClass().getName() + run + " " + deactivate);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,12 +104,10 @@ public abstract class Worker {
|
|||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
logger.debug("Worker: stop()");
|
logger.debug("Worker: stop()");
|
||||||
logger.debug("Worker: stop() " + active + " " + activate);
|
|
||||||
if (active && !activate) {
|
if (active && !activate) {
|
||||||
deactivate = true;
|
deactivate = true;
|
||||||
}
|
}
|
||||||
activate = false;
|
activate = false;
|
||||||
logger.debug("Worker: stop() " + deactivate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract public void exit();
|
abstract public void exit();
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ public class TestUdpMulticastCommunication {
|
|||||||
synchronized (client) {
|
synchronized (client) {
|
||||||
client.wait(2000);
|
client.wait(2000);
|
||||||
}
|
}
|
||||||
System.err.println("after wait");
|
|
||||||
byte[] buffer = client.buffer;
|
byte[] buffer = client.buffer;
|
||||||
assertNotNull("Received input", buffer);
|
assertNotNull("Received input", buffer);
|
||||||
assertEquals("Message intact", message, new String(buffer).trim());
|
assertEquals("Message intact", message, new String(buffer).trim());
|
||||||
@@ -56,7 +55,6 @@ public class TestUdpMulticastCommunication {
|
|||||||
|
|
||||||
protected void input(byte[] buffer) {
|
protected void input(byte[] buffer) {
|
||||||
this.buffer = buffer;
|
this.buffer = buffer;
|
||||||
System.err.println("binnen");
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
notifyAll();
|
notifyAll();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user