Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Connection;
- import java.io.ObjectInputStream;
- import java.io.ObjectOutputStream;
- public class WaitingForMessage {
- ObjectInputStream OIS;
- ObjectOutputStream OOS;
- public WaitingForMessage(ObjectInputStream ois,ObjectOutputStream oos) {
- Thread thread = new Thread(){
- public void run(){
- ObjectInputStream input = ois;
- ObjectOutputStream output = oos;
- Boolean aktive = true;
- while(aktive){
- try {
- byte[][] message = (byte[][])input.readObject();
- new InputListener(message,output);
- } catch (Exception e) {
- if(e.getMessage().equals("Connection reset")){
- aktive = false;
- this.interrupt();
- }
- }
- }
- }
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement