1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
   |  
import java.io.IOException;
import java.net.Socket;
import java.util.Date;
 
import kConst.Constantes;
 
public class Clients extends Thread {
	private Socket client;  	
 
	public Clients(){
        try{                    
	       	System.out.println(new Date()+ "==> Tentative de connexion au serveur "+ Constantes.host + " port "+ kConst.Constantes.PORT);
	       	client = new Socket(Constantes.host, Constantes.PORT);
	    }
      	catch ( IOException e )
	    {
	    	System.out.println(new Date()+ "==> Impossible de se connecter au serveur ");	       		
	    }      		
 
    } // !constructeur
 
	public void run(){
		try{
 
	    	TrameVehicule tramevehicule = new TrameVehicule(this.client);	    	
 
	    }catch (Exception e){System.err.println(e);}
	  }// ! run() method
}// ! Clients class | 
Partager