3 import org.web3d.x3d.sai.*;
17 Applet FreeWLRSceneInterface;
20 boolean debug =
false;
27 private PrintWriter EAItoBrowserPrintWriter = null;
33 FreeWLRSceneInterface=d;
35 EAItoBrowserPrintWriter = pwtoBrowserjava;
49 EAIin =
new BufferedReader(
new InputStreamReader(sock.getInputStream()));
50 }
catch (IOException e) {
51 System.out.print (
"error reiniting data input stream");
62 reply =
new String (
"");
64 while (reply != null) {
66 reply = EAIin.readLine();
68 if (reply.equals(
"EV")) {
69 EVTime = EAIin.readLine();
70 BrowserGlobals.TickTime = Double.parseDouble(EVTime);
72 EVentno = EAIin.readLine();
73 int eventno = Integer.parseInt(EVentno);
74 if (debug) System.out.println (
"EAIinThread 3 reply is " + EVentno);
76 EVentreply =
new String (
"");
77 reply = EAIin.readLine();
78 if (debug) System.out.println (
"EAIinThread 5 reply is " + reply);
81 while (!reply.equals(
"EV_EOT")) {
82 EVentreply = EVentreply + reply;
83 reply = EAIin.readLine();
87 System.out.println (
"EAIinThread sending EVentno: " +
88 EVentno +
" EventReply " + EVentreply +
" reply " + reply);
90 mybrowser.Browser_RL_Async_send(EVentreply,eventno);
91 }
else if (reply.equals(
"RE")) {
92 EVTime = EAIin.readLine();
93 BrowserGlobals.TickTime = Double.parseDouble(EVTime);
96 EAItoBrowserPrintWriter.println(EAIin.readLine());
99 EVentreply =
new String (
"");
101 reply = EAIin.readLine();
102 if (debug) System.out.println (
"EAIinThread 5xx reply is " + reply);
105 while (!reply.equals(
"RE_EOT")) {
106 EVentreply = EVentreply + reply;
107 reply = EAIin.readLine();
110 EAItoBrowserPrintWriter.println(EVentreply);
112 EAItoBrowserPrintWriter.flush();
114 }
else if (reply.equals (
"QUIT")) {
115 if (debug) System.out.println (
"EAIinThread, got the quit signal");
118 System.out.println (
"expecting REor EV, got " + reply);
119 if (debug) System.out.println (
"EAIinThread 9 reply is " + reply);
122 }
catch (IOException e) {