=================================================================== RCS file: /home/cvs/OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v retrieving revision 1.8 retrieving revision 1.10 diff -u -p -r1.8 -r1.10 --- OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java 2001/11/04 09:58:14 1.8 +++ OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java 2002/10/27 10:39:32 1.10 @@ -1,5 +1,5 @@ /** - * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.7 2001/11/01 08:54:50 takayama Exp $ + * $OpenXM: OpenXM/src/OpenMath/ORG/openxm/tam/OpenXM.java,v 1.9 2002/10/23 08:40:16 takayama Exp $ */ package ORG.openxm.tam; @@ -84,8 +84,57 @@ public class OpenXM{ stream.sendByteOrder(); } + public OpenXM(String host,int CtrlPort,int StreamPort,String ox_server,int oxd_port,String pass) + throws IOException{ + // pass may be a null string. + control = new OpenXMstream(host,CtrlPort,pass); + stream = new OpenXMstream(host,StreamPort,pass); + System.err.println("Listening..."); + System.err.println("Launch ox server with the reverse option, e.g., ox -ox ox_asir -reverse"); + // Launch ox_server by the oxd daemon (oxd_port). + // BUG: It has not yet been implemented. + control.OpenXMstreamAccept(); + System.err.println("Accepted the control port."); + stream.OpenXMstreamAccept(); + System.err.println("Accepted the data port."); + + + control.sendByteOrder(); + stream.sendByteOrder(); + } + +public OpenXM(String ox_server) throws IOException { + int oxdPort = 8089; + String host = "localhost"; + oxdStream oxd = new oxdStream(oxdPort); + int cport,dport; + cport = oxd.startPhase1(); + dport = cport+1; + try { + control = new OpenXMstream(host,cport,""); + stream = new OpenXMstream(host,dport,""); + }catch( IOException e) { + System.err.println("Could not open ports for client."); + oxd.write(""); + } + + System.err.println("Listenning..."); + + oxd.startPhase2(ox_server,cport); + + control.OpenXMstreamAccept(); + System.err.println("Accepted the control port."); + stream.OpenXMstreamAccept(); + System.err.println("Accepted the data port."); + + + control.sendByteOrder(); + stream.sendByteOrder(); +} + + /*&ja - * 接続の初期化を行なう. 現在は未実装. + * サーバの計算中断を行なう. 現在は未実装. */ /** * Resetting the engine process. It has not yet been implemented.