FileDocCategorySizeDatePackage
Start.javaAPI DocAzureus 3.0.3.42323Thu Feb 09 19:43:24 GMT 2006org.gudy.azureus2.ui.swt.osx

Start

public class Start extends Object

Fields Summary
Constructors Summary
public Start(String[] args)

//      if(args.length == 0)
//        return;

      Socket sck = null;
      PrintWriter pw = null;
      try {          
        System.out.println("StartSocket: passing startup args to already-running Azureus java process.");
        
        sck = new Socket("127.0.0.1", 6880);
        
        pw = new PrintWriter(new OutputStreamWriter(sck.getOutputStream(),"UTF8"));
        
        StringBuffer buffer = new StringBuffer("Azureus Start Server Access;args;");
        
        for(int i = 0 ; i < args.length ; i++) {
          String arg = args[i].replaceAll("&","&&").replaceAll(";","&;");
          buffer.append(arg);
          buffer.append(';");
        }
       
        pw.println(buffer.toString());
        pw.flush();
      } catch(Exception e) {
      	Debug.printStackTrace( e );
      } finally {
        try {
          if (pw != null)
            pw.close();
        } catch (Exception e) {
        }
        try {
          if (sck != null)
            sck.close();
        } catch (Exception e) {
        }
      }
    
Methods Summary
public static voidmain(java.lang.String[] args)

      new Start(args);