1 package vrml.external.FreeWRLEAI;
3 import vrml.external.*;
18 Applet FreeWLRSceneInterface;
21 boolean debug =
false;
28 private PrintWriter EAItoBrowserPrintWriter = null;
34 FreeWLRSceneInterface=d;
36 EAItoBrowserPrintWriter = pwtoBrowserjava;
50 EAIin =
new BufferedReader(
new InputStreamReader(sock.getInputStream()));
51 }
catch (IOException e) {
52 System.out.print (
"error reiniting data input stream");
63 reply =
new String (
"");
65 while (reply != null) {
67 reply = EAIin.readLine();
69 if (reply.equals(
"EV")) {
70 EVTime = EAIin.readLine();
71 BrowserGlobals.TickTime = Double.parseDouble(EVTime);
73 EVentno = EAIin.readLine();
74 int eventno = Integer.parseInt(EVentno);
75 if (debug) System.out.println (
"EAIinThread 3 reply is " + EVentno);
77 EVentreply =
new String (
"");
78 reply = EAIin.readLine();
79 if (debug) System.out.println (
"EAIinThread 5 reply is " + reply);
82 while (!reply.equals(
"EV_EOT")) {
83 EVentreply = EVentreply + reply;
84 reply = EAIin.readLine();
88 System.out.println (
"EAIinThread sending EVentno: " +
89 EVentno +
" EventReply " + EVentreply +
" reply " + reply);
91 mybrowser.Browser_RL_Async_send(EVentreply,eventno);
92 }
else if (reply.equals(
"RE")) {
93 EVTime = EAIin.readLine();
94 BrowserGlobals.TickTime = Double.parseDouble(EVTime);
97 EAItoBrowserPrintWriter.println(EAIin.readLine());
100 EVentreply =
new String (
"");
102 reply = EAIin.readLine();
103 if (debug) System.out.println (
"EAIinThread 5xx reply is " + reply);
106 while (!reply.equals(
"RE_EOT")) {
107 EVentreply = EVentreply + reply;
108 reply = EAIin.readLine();
111 EAItoBrowserPrintWriter.println(EVentreply);
113 EAItoBrowserPrintWriter.flush();
115 }
else if (reply.equals (
"QUIT")) {
116 if (debug) System.out.println (
"EAIinThread, got the quit signal");
119 System.out.println (
"expecting REor EV, got " + reply);
120 if (debug) System.out.println (
"EAIinThread 9 reply is " + reply);
123 if (debug) System.out.println (
"EAIinThread closing stream");
125 }
catch (IOException e) {