voila mon code...
création du process :
public void connect(String connexion,String pseudo,String passe) throws RemoteException
{
StringTokenizer ana = new StringTokenizer(connection," " );
commande=ana.nextToken();
con=ana.nextToken();
pseu=ana.nextToken();
pas=ana.nextToken();
if (!(con.equals(connexion)&&pseu.equals(pseudo)&&pas.equals(passe)))
{
String nouv= commande+" "+connexion+" "+pseudo+" "+passe;
cop.setParams("CONNECT",nouv);
connection=nouv;
}
nbClients++;
if (nbClients>0)
{
try
{
pConn=Runtime.getRuntime().exec(connection);
}
catch(Exception ex)
{
System.out.println("problem pour lancer la connection"+ex);
}
}
}
fonction qui renvoie (appel périodique du client) les sortie consoles!
public String getInputStreamProcess() throws RemoteException
{
if (pConn!=null)
{
try
{
byte[] tab=new byte[1000];
System.out.println("avant" );
pConn.getInputStream().read(tab);
System.out.println("aprés" );
String tmp = new String (tab);
CRprocess=CRprocess+tmp;
}
catch (Exception ex)
{
System.out.println("pb avec io.. "+ex);
}
return CRprocess;
}
else
return null;
}