import java.io.*; 
import java.net.*; 

class TCPServer {   

	public static void main(String argv[]) throws Exception  
	{         
		String clientSentence;      
		String capitalizedSentence;       
		ServerSocket welcomeSocket = new ServerSocket(8081);      

		while(true)   
		{        
			System.out.println("Serveur attend une connexion ...");     
			Socket connexion = welcomeSocket.accept();        
			BufferedReader inFromClient =  new BufferedReader(new InputStreamReader(connexion.getInputStream()));     
			DataOutputStream outToClient = new DataOutputStream(connexion.getOutputStream());    
			clientSentence = inFromClient.readLine();        
			System.out.println("Received: " + clientSentence);      
			//capitalizedSentence = clientSentence.toUpperCase() + '\n';     
			//outToClient.writeBytes(capitalizedSentence);        
		}    
	} 
} 