Skip to content

Commit aebb72d

Browse files
committed
updated InputStreamThread.java and OutputStreamThread.java
1 parent 623bb5e commit aebb72d

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/de/javasocketapi/core/Client.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public void connect() throws IOException {
4343
}
4444
//start reading and writing
4545
this.inputStreamThread = new InputStreamThread(this);
46-
this.inputStreamThread.start();
46+
this.inputStreamThread.run();
4747
this.outputStreamThread = new OutputStreamThread(this);
48-
this.outputStreamThread.start();
48+
this.outputStreamThread.run();
4949
}
5050

5151
@Override

src/de/javasocketapi/core/InputStreamThread.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.TimerTask;
99
import java.util.UUID;
1010

11-
class InputStreamThread extends Thread {
11+
class InputStreamThread {
1212

1313
private Client client;
1414
private Socket socket;
@@ -23,9 +23,7 @@ public InputStreamThread(final Client client) {
2323
this.socket = this.client.getSocket();
2424
}
2525

26-
@Override
2726
public void run() {
28-
super.run();
2927
//initialise inputStream
3028
InputStream inputStream = null;
3129
try {
@@ -84,9 +82,7 @@ public void run() {
8482
}, 0, 1);
8583
}
8684

87-
@Override
8885
public void interrupt() {
89-
super.interrupt();
9086
this.timer.cancel();
9187
}
9288
}

src/de/javasocketapi/core/OutputStreamThread.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.Timer;
1010
import java.util.TimerTask;
1111

12-
class OutputStreamThread extends Thread {
12+
class OutputStreamThread {
1313

1414
private Client client;
1515
private Socket socket;
@@ -26,9 +26,7 @@ public OutputStreamThread(final Client client) {
2626
this.socket = this.client.getSocket();
2727
}
2828

29-
@Override
3029
public void run() {
31-
super.run();
3230
//initialise outputStream
3331
OutputStream outputStream = null;
3432
try {
@@ -95,9 +93,7 @@ public void run() {
9593
}, 0, 1);
9694
}
9795

98-
@Override
9996
public void interrupt() {
100-
super.interrupt();
10197
this.timer.cancel();
10298
}
10399

0 commit comments

Comments
 (0)