synchronized su awarenes e chat via tcp

This commit is contained in:
2014-12-02 21:50:57 +01:00
parent 1ef2207245
commit 40a630623a
7 changed files with 296 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
package socket_chat_tcp;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.logging.Logger;
/**
* Created with xgiovio.macbookair.
* User: xgiovio
* Date: 02/12/14
* Time: 14:04
*/
public class ClientInputManagement extends Thread {
private static final Logger l = Logger.getLogger(ClientInputManagement.class.getName());
public ClientInputManagement (DataInputStream input){
i=input;
}
@Override
public void run() {
while (true){
try {
String ridden = i.readUTF();
System.out.println(ridden);
} catch (IOException e) {
System.out.println("Bye");
break;
}
}
}
private final DataInputStream i;
}