File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed
src/de/javasocketapi/core Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 88import java .util .TimerTask ;
99import 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}
Original file line number Diff line number Diff line change 99import java .util .Timer ;
1010import 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
You can’t perform that action at this time.
0 commit comments