version 1.1, 1999/11/02 11:52:34 |
version 1.3, 1999/11/03 07:19:16 |
|
|
|
/** |
|
* $OpenXM: OpenXM/src/OpenMath/OMproxy.java,v 1.2 1999/11/02 13:09:19 tam Exp $ |
|
*/ |
|
|
import JP.ac.kobe_u.math.tam.OpenXM.*; |
import JP.ac.kobe_u.math.tam.OpenXM.*; |
import java.util.Stack; |
import java.util.Stack; |
import java.io.*; |
import java.io.*; |
Line 60 class OMproxy implements Runnable{ |
|
Line 64 class OMproxy implements Runnable{ |
|
private void SM_executeFunction() throws java.io.IOException{ |
private void SM_executeFunction() throws java.io.IOException{ |
String function_name; |
String function_name; |
CMO[] argv; |
CMO[] argv; |
int argc; |
int argc = 1; |
|
|
if(!(stack.peek() instanceof CMO_STRING)){ |
if(!(stack.peek() instanceof CMO_STRING)){ |
stack.push(new CMO_ERROR2()); |
stack.push(new CMO_ERROR2()); |
return; |
return; |
} |
} |
function_name = ((CMO_STRING)stack.pop()).getString(); |
function_name = ((CMO_STRING)stack.pop()).getString(); |
argc = ((CMO_INT32)stack.pop()).intValue(); |
//argc = ((CMO_INT32)stack.pop()).intValue(); |
argv = new CMO[argc]; |
argv = new CMO[argc]; |
for(int i=0;i<argc;i++){ |
for(int i=0;i<argc;i++){ |
argv[i] = (CMO)stack.pop(); |
argv[i] = (CMO)stack.pop(); |
Line 131 class OMproxy implements Runnable{ |
|
Line 135 class OMproxy implements Runnable{ |
|
return ret; |
return ret; |
} |
} |
|
|
|
private static String usage(){ |
|
String ret = ""; |
|
|
|
ret += "usage\t: java OMproxy [options]\n"; |
|
ret += "options\t:\n"; |
|
ret += "\t -h \t show this message\n"; |
|
ret += "\t -host hostname \t (default localhost)\n"; |
|
ret += "\t -data port \t (default 1300)\n"; |
|
ret += "\t -control port \t (default 1200)\n"; |
|
|
|
return ret; |
|
} |
|
|
public static void main(String argv[]){ |
public static void main(String argv[]){ |
String host = "localhost"; |
String host = "localhost"; |
int DataPort = 1300, ControlPort = 1200; |
int DataPort = 1300, ControlPort = 1200; |
|
|
for(int i=0;i<argv.length;i++){ |
for(int i=0;i<argv.length;i++){ |
if(argv[i].equals("-h")){ |
if(argv[i].equals("-h")){ |
System.out.println(""); |
System.out.print(usage()); |
System.exit(0); |
System.exit(0); |
}else if(argv[i].equals("-host")){ |
}else if(argv[i].equals("-host")){ |
host = argv[++i]; |
host = argv[++i]; |
Line 146 class OMproxy implements Runnable{ |
|
Line 163 class OMproxy implements Runnable{ |
|
}else if(argv[i].equals("-control")){ |
}else if(argv[i].equals("-control")){ |
ControlPort = Integer.valueOf(argv[++i]).intValue(); |
ControlPort = Integer.valueOf(argv[++i]).intValue(); |
}else{ |
}else{ |
System.err.println("unknown option :"+ argv[i]); |
System.err.println("unknown option : "+ argv[i]); |
|
System.err.print(usage()); |
System.exit(1); |
System.exit(1); |
} |
} |
} |
} |
|
|
System.out.println("host(ctrl,data): "+ host |
System.out.println("host(ctrl,data): "+ host |
+"("+ ControlPort +","+ DataPort +")"); |
+"("+ ControlPort +","+ DataPort +")"); |
|
|