X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Ftests%2FEcho.java;h=670b818d09833f1535b20bb9206d2d0fc7f3c332;hp=47f8046f245f840ed70ed9a4e946885cc50abda6;hb=b11e7c6c29f2b5f7b0828bf93eb741c4a30ec411;hpb=3eb15f58ca0911489d7d9bdc0ac2c575d27a68d8;ds=sidebyside diff --git a/src/tests/Echo.java b/src/tests/Echo.java index 47f8046..670b818 100644 --- a/src/tests/Echo.java +++ b/src/tests/Echo.java @@ -1,8 +1,12 @@ +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package tests; import java.net.*; -import org.xwt.mips.Runtime; +import org.ibex.nestedvm.Runtime; public class Echo { private static final int PORT = 2000; @@ -18,14 +22,15 @@ public class Echo { public void go() { new Thread(this).start(); } public void run() { try { - Runtime task = new EchoHelper(); - int status = task.run( - new String[]{"EchoHelper"}, - null, - new Runtime.InputStreamFD(sock.getInputStream()), - new Runtime.OutputStreamFD(sock.getOutputStream()), - null - ); + Runtime task = (Runtime) Class.forName("tests.EchoHelper").newInstance(); + task.closeFD(0); + task.closeFD(1); + //task.closeFD(2); + task.addFD(new Runtime.InputOutputStreamFD(sock.getInputStream())); + task.addFD(new Runtime.InputOutputStreamFD(sock.getOutputStream())); + //task.dupFD(1); + + int status = task.run(new String[]{"EchoHelper"} ); System.err.println("Exit status: " + status); } catch(Exception e) { System.err.println(e);