import java.io.BufferedWriter; import java.io.OutputStreamWriter; import java.net.Socket; /* * Created on 28 oct. 2004 */ public class SecureClient implements Runnable { public static void main(String[] args) { new Thread( new SecureClient()).start(); } public void run(){ CommonSocketFactory csf = new CommonSocketFactory(); Socket s = null; try{ s=csf.createClientSocket("localhost",true); System.out.println("socket client:" +s); System.out.println("connexion avec le serveur etablie"); System.out.println("Message envoye: Salut"); BufferedWriter bw = new BufferedWriter( new OutputStreamWriter( s.getOutputStream())); bw.write("Salut\n"); bw.flush(); } catch (Exception e){ System.out.println(e); } } }