synchronized su awarenes e chat via tcp
This commit is contained in:
38
socket_chat_tcp/ClientInputManagement.java
Normal file
38
socket_chat_tcp/ClientInputManagement.java
Normal 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user