root / trunk / code / projects / colonet / client / ColonetServerInterface.java @ 648
History | View | Annotate | Download (19 KB)
1 |
/*
|
---|---|
2 |
* ColonetServerInterface.java
|
3 |
* Gregory Tress
|
4 |
*/
|
5 |
|
6 |
import java.net.*; |
7 |
import java.io.*; |
8 |
import javax.swing.JOptionPane; |
9 |
import javax.swing.JTextArea; |
10 |
|
11 |
/**
|
12 |
* The Colonet server interface class. This class handles direct communication with the Colonet server. The general
|
13 |
* contract is that this class will encapsulate the process of sending commands and requests to the server and
|
14 |
* receiving responses. This class should provide methods to send specific commands and requests so that the
|
15 |
* Colonet can easily communicate with the server. When data is received from the server, the ColonetServerInterface
|
16 |
* decides how to handle it and in many cases this means simply passing it to the Colonet.
|
17 |
* <p>
|
18 |
* The motivation is that any number of Colonet-type classes could be designed for different purposes if needed, with
|
19 |
* this class being used by each one for communication.
|
20 |
* For instance, if an application is designed which only monitors sensor data, or that only has access to
|
21 |
* the task queue, etc., the application could easily plug in to this interface.
|
22 |
* The Colonet should generally not contain communication-specific code or Strings of command and request data.
|
23 |
* If additional commands and requests are needed for permanent implementation, it is suggested that convenience
|
24 |
* classes be created in the ColonetServerInterface and called from the Colonet.
|
25 |
*
|
26 |
* @author Gregory Tress
|
27 |
*/
|
28 |
public class ColonetServerInterface |
29 |
{ |
30 |
/* Old packet structure:
|
31 |
|
32 |
COMMAND PACKET STRUCTURE
|
33 |
1: SEND_TO_ROBOT
|
34 |
2: # of robot, or GLOBAL_DEST
|
35 |
3: COLONET_COMMMAND
|
36 |
4: message code (i.e. ORB_SET)
|
37 |
5: any data, as many that fit in the packet
|
38 |
|
39 |
REQUEST PACKET STRUCTURE
|
40 |
1: REQUEST_FROM_SERVER
|
41 |
2: # of robot
|
42 |
3: COLONET_REQUEST
|
43 |
4: ???
|
44 |
|
45 |
9/12/07 New server interface structure
|
46 |
Client will no longer send full robot packets to the server.
|
47 |
Commands will be defined as necessary.
|
48 |
*/
|
49 |
|
50 |
//General Colonet Interface
|
51 |
public static final String SEND_TO_ROBOT = "0"; |
52 |
public static final String REQUEST_FROM_SERVER = "1"; |
53 |
public static final String RESPONSE_TO_CLIENT_REQUEST = "2"; |
54 |
public static final String REQUEST_BOM_MATRIX = "144"; |
55 |
public static final String REQUEST_XBEE_IDS = "145"; |
56 |
|
57 |
public static final String COLONET_COMMAND = "13"; //0x0D |
58 |
public static final String COLONET_REQUEST = "14"; //0x0E |
59 |
public static final String CORONET_RESPONSE = "15"; //0x0F |
60 |
public static final String GLOBAL_DEST = "200"; |
61 |
public static final String CLIENT_REQUEST_ROBOT_POSITIONS = "86"; |
62 |
public static final String CLIENT_ASSIGN_ROBOT_ID = "87"; |
63 |
public static final String MOVE_TO_ABSOLUTE_POSITION = "83"; //0x53 |
64 |
|
65 |
//Queue instructions
|
66 |
public static final String COLONET_QUEUE = "100"; |
67 |
public static final String QUEUE_UPDATE = "101"; |
68 |
public static final String QUEUE_ADD = "102"; |
69 |
public static final String QUEUE_REMOVE = "103"; |
70 |
public static final String QUEUE_REORDER = "104"; |
71 |
|
72 |
//Use BATTERY to request battery level
|
73 |
public static final String BATTERY = "56"; //0x38 |
74 |
|
75 |
//MOTORS
|
76 |
public static final String MOTORS_INIT = "23"; //0x17 |
77 |
public static final String MOTOR1_SET = "24"; //0x18 |
78 |
public static final String MOTOR2_SET = "25"; //0x19 |
79 |
public static final String MOTORS_OFF = "26"; //0x1A |
80 |
public static final String MOVE = "27"; //0x1B |
81 |
public static final String MOVE_AVOID = "28"; //0x1C |
82 |
public static final String MOVE_R = "29"; //0x1D |
83 |
public static final String MOVE_L = "30"; //0x1E |
84 |
public static final String MOVE_F = "31"; //0x1F |
85 |
public static final String MOVE_B = "32"; //0x1G |
86 |
|
87 |
//BUZZER
|
88 |
public static final String BUZZER_INIT = "0"; //0x00 |
89 |
public static final String BUZZER_SET_VAL = "1"; //0x01 |
90 |
public static final String BUZZER_SET_FREQ = "2"; //0x02 |
91 |
public static final String BUZZER_CHIRP = "3"; //0x03 |
92 |
public static final String BUZZER_OFF = "4"; //0x04 |
93 |
|
94 |
//ORB
|
95 |
public static final String ORB_INIT = "12"; //0x0C |
96 |
public static final String ORB_SET = "13"; //0x0D |
97 |
public static final String ORB_SET_COLOR = "14"; //0x0E |
98 |
public static final String ORB_DISABLE = "15"; //0x0F |
99 |
public static final String ORB_ENABLE = "16"; //0x10 |
100 |
public static final String ORB_SET_DIO = "17"; //0x11 |
101 |
public static final String LED_INIT = "18"; //0x12 |
102 |
public static final String LED_USER = "19"; //0x13 |
103 |
public static final String ORB_SET_NUM_NS = "20"; //0x14 |
104 |
public static final String ORB_SET_NUM = "21"; //0x15 |
105 |
public static final String ORB_SEND = "22"; //0x16 |
106 |
|
107 |
Colonet colonet; //save reference to the entire applet locally
|
108 |
Socket socket;
|
109 |
OutputStreamWriter out;
|
110 |
BufferedReader reader;
|
111 |
DataListener dataListener; |
112 |
|
113 |
/*
|
114 |
* FUNCTION IMPLEMENTATIONS
|
115 |
*/
|
116 |
|
117 |
/**
|
118 |
* Constructs a new ColonetServerInterface. When constructing a ColonetServerInterface, a valid Colonet object
|
119 |
* reference must be provided to ensure that data is routed correctly.
|
120 |
*
|
121 |
* @param colonet The Colonet object to save locally. This reference cannot be changed once the
|
122 |
* ColonetSreverInterface has been contsructed.
|
123 |
* @throws NullPointerException if colonet is null
|
124 |
*
|
125 |
*/
|
126 |
public ColonetServerInterface (Colonet colonet) {
|
127 |
this.colonet = colonet;
|
128 |
dataListener = new DataListener();
|
129 |
} |
130 |
|
131 |
public Socket getSocket () { |
132 |
return socket;
|
133 |
} |
134 |
|
135 |
public OutputStreamWriter getOutputStreamWriter () { |
136 |
return out;
|
137 |
} |
138 |
|
139 |
public BufferedReader getBufferedReader () { |
140 |
return reader;
|
141 |
} |
142 |
|
143 |
public boolean isReady () { |
144 |
if (socket == null || out == null || reader == null) |
145 |
return false; |
146 |
if (!socket.isConnected() || socket.isClosed() || socket.isInputShutdown() || socket.isOutputShutdown())
|
147 |
return false; |
148 |
return true; |
149 |
} |
150 |
|
151 |
public boolean isInputReady () { |
152 |
try {
|
153 |
if (reader.ready()) return true; |
154 |
} catch (Exception e) { |
155 |
return false; |
156 |
} |
157 |
return false; |
158 |
} |
159 |
|
160 |
public String getLine () throws IOException { |
161 |
return reader.readLine();
|
162 |
} |
163 |
|
164 |
/**
|
165 |
* Create socket connection to Colonet server.
|
166 |
* If successful, start thread for listening for incoming data.
|
167 |
*/
|
168 |
public void connect (String strHost, String strPort) { |
169 |
//make sure hostname and port are valid
|
170 |
if (strHost.equals("") || strPort.equals("")) { |
171 |
err("Please enter a hostname and port.");
|
172 |
return;
|
173 |
} |
174 |
int port = 0; |
175 |
try {
|
176 |
port = Integer.parseInt(strPort);
|
177 |
} catch (Exception e) { |
178 |
err("Invalid port");
|
179 |
return;
|
180 |
} |
181 |
|
182 |
//make sure we aren't already connected.
|
183 |
if (socket != null && socket.isConnected()) { |
184 |
return;
|
185 |
} |
186 |
|
187 |
try {
|
188 |
socket = new Socket(strHost, port); |
189 |
socket.setKeepAlive(true);
|
190 |
} catch (UnknownHostException e) { |
191 |
err("Unknown Host Exception");
|
192 |
return;
|
193 |
} catch (IOException e) { |
194 |
err("Failed to connect to " + strHost + ".\n"); |
195 |
return;
|
196 |
} catch (java.security.AccessControlException e) {
|
197 |
err("Permission denied.\n\n"
|
198 |
+ "You may only connect to the server from which this applet was loaded.");
|
199 |
return;
|
200 |
} |
201 |
|
202 |
if (socket == null || !socket.isConnected()) { |
203 |
return;
|
204 |
} |
205 |
try {
|
206 |
out = new OutputStreamWriter(socket.getOutputStream()); |
207 |
reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
208 |
} catch (IOException e) { |
209 |
warn("Could not get transfer streams from socket connection.");
|
210 |
} |
211 |
|
212 |
dataListener.start(); |
213 |
} |
214 |
|
215 |
public void disconnect () { |
216 |
try {
|
217 |
if (reader != null) { |
218 |
reader.close(); |
219 |
} |
220 |
if (out != null) { |
221 |
out.close(); |
222 |
} |
223 |
colonet.disconnect(); |
224 |
} catch (IOException e) { |
225 |
} |
226 |
} |
227 |
|
228 |
/*
|
229 |
* Send a general String to the OutputStream.
|
230 |
*/
|
231 |
private void sendString (String s) { |
232 |
//make sure we can send
|
233 |
if (!this.isReady()) { |
234 |
colonet.getInfoPanel().append("Could not send data.\n");
|
235 |
return;
|
236 |
} |
237 |
//send packet
|
238 |
try {
|
239 |
Thread.sleep(100); //pause to be safe |
240 |
out.write(s); |
241 |
out.flush(); |
242 |
} catch (IOException e) { |
243 |
colonet.getInfoPanel().setText("Could not send data.\n");
|
244 |
} catch (InterruptedException e) { |
245 |
} |
246 |
} |
247 |
|
248 |
/**
|
249 |
* General send-to-server method. This method is used by other command methods, which are usually convenience
|
250 |
* methods that simply specify arguments to this method. A command consists of a String which holds integers
|
251 |
* separated by spaces. This method should not be used directly unless you know the format of the particular
|
252 |
* command you are sending. If implementing a particular command for permanent use, it is recommended that
|
253 |
* you create a new wrapper method specific to that command in the ColonetServerInterface file.
|
254 |
*
|
255 |
* Note that no checking is performed in this method to ensure the correct formatting of the String arguments.
|
256 |
* If malformed commands or robot numbers are specified, the behavior of the request at the server will be
|
257 |
* undefined and could result in server failure.
|
258 |
*
|
259 |
* @param s The command String in its correct format. The format of a command String is ultimately specified
|
260 |
* by the Colonet server application and may change.
|
261 |
* @param robotNumber The number of the robot that is the subject of the command, if any. The robot number
|
262 |
* is specified as a single integer in a String. If the command does not have a single robot subject, this
|
263 |
* argument can be null or an empty String, whichever is convenient.
|
264 |
*/
|
265 |
public void sendData (String s, String robotNumber) { |
266 |
//create packet
|
267 |
String packet = ""; |
268 |
packet += ColonetServerInterface.SEND_TO_ROBOT; |
269 |
if (robotNumber != null) |
270 |
packet += " " + robotNumber;
|
271 |
packet += " " + ColonetServerInterface.COLONET_COMMAND;
|
272 |
packet += " " + s; //add the command code here |
273 |
packet += "\n";
|
274 |
sendString(packet); |
275 |
//colonet.getInfoPanel().append("S:" + packet);
|
276 |
} |
277 |
|
278 |
/**
|
279 |
* General request-from-server method. This method is used by other request methods, which are usually convenience
|
280 |
* methods that simply specify arguments to this method. A request consists of a String which holds integers
|
281 |
* separated by spaces. This method should not be used directly unless you know the format of the particular
|
282 |
* request you are making. If implementing a particular request, it is recommended that you create a new method
|
283 |
* specific to that request in the ColonetServerInterface file.
|
284 |
*
|
285 |
*/
|
286 |
private void sendRequest (String s, String robotNumber) { |
287 |
//create packet
|
288 |
String packet = ""; |
289 |
packet += ColonetServerInterface.REQUEST_FROM_SERVER; |
290 |
packet += " " + robotNumber;
|
291 |
packet += " " + s; //add the command code here |
292 |
packet += "\n";
|
293 |
sendString(packet); |
294 |
} |
295 |
|
296 |
/**
|
297 |
* Sends a request to the server to report the entire BOM sensor matrix. The server will reply at its convenience.
|
298 |
* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
|
299 |
* to any individual request.
|
300 |
*/
|
301 |
public void sendSensorDataRequest () { |
302 |
sendRequest(ColonetServerInterface.REQUEST_BOM_MATRIX, "");
|
303 |
} |
304 |
|
305 |
/**
|
306 |
* Sends a request to the server to report a list of XBee IDs. The server will reply at its convenience.
|
307 |
* The purpose of having this list is to ensure that robots are properly identified for control purposes.
|
308 |
* This keeps robot identification consistent between sessions and prevents arbitrary assignment.
|
309 |
* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
|
310 |
* to any individual request.
|
311 |
*
|
312 |
* @see Colonet#parseXBeeIDs(String)
|
313 |
*/
|
314 |
public void sendXBeeIDRequest () { |
315 |
sendRequest(ColonetServerInterface.REQUEST_XBEE_IDS, "");
|
316 |
} |
317 |
|
318 |
/**
|
319 |
* Sends a battery request for a specific robot to the server. The server will reply at its convenience.
|
320 |
* Behavior is undefined if an invalid robot number is specified. The server will probably not respond in
|
321 |
* this case.
|
322 |
* No guarantee is made (end-to-end or otherwise) that the server will respond in a timely manner or at all
|
323 |
* to any individual request.
|
324 |
*
|
325 |
* @param robotNum The number of the robot for which we are requesting the battery. Note that this value
|
326 |
* is sent as-is to the server. No mapping to or from XBee IDs is performed. The contract for this is
|
327 |
* currently undefined.
|
328 |
* @see Colonet#parseBattery(String)
|
329 |
*/
|
330 |
public void sendBatteryRequest (int robotNum) { |
331 |
//create packet
|
332 |
String packet = ""; |
333 |
packet += ColonetServerInterface.SEND_TO_ROBOT; |
334 |
packet += " " + robotNum;
|
335 |
packet += " " + ColonetServerInterface.COLONET_REQUEST;
|
336 |
packet += " " + ColonetServerInterface.BATTERY; //add the command code here |
337 |
packet += "\n";
|
338 |
sendString(packet); |
339 |
//System.out.println("Sent battery request: " + packet);
|
340 |
} |
341 |
|
342 |
/**
|
343 |
* Requests a list of all robot positions and correspondind robot IDs.
|
344 |
*/
|
345 |
public void sendPositionRequest () { |
346 |
sendRequest(ColonetServerInterface.CLIENT_REQUEST_ROBOT_POSITIONS, "");
|
347 |
} |
348 |
|
349 |
/**
|
350 |
* Send a robot ID assignment update to store on the server.
|
351 |
*/
|
352 |
public void sendIDAssignment (int oldID, int newID) { |
353 |
String packet = ""; |
354 |
packet += ColonetServerInterface.REQUEST_FROM_SERVER; |
355 |
packet += " " + CLIENT_ASSIGN_ROBOT_ID;
|
356 |
packet += " " + oldID + " " + newID; |
357 |
packet += "\n";
|
358 |
sendString(packet); |
359 |
} |
360 |
|
361 |
/**
|
362 |
* Order a robot to move to an absolute coordinate point.
|
363 |
*/
|
364 |
public void sendAbsoluteMove (int id, int x, int y) { |
365 |
int x_high = (x>>8) & 0xff; |
366 |
int x_low = x & 0xff; |
367 |
int y_high = (y>>8) & 0xff; |
368 |
int y_low = y & 0xff; |
369 |
|
370 |
sendData(MOVE_TO_ABSOLUTE_POSITION + " " + x_high + " " + x_low + " " + y_high + " " + y_low, "" + id); |
371 |
} |
372 |
|
373 |
/*
|
374 |
* Queue management
|
375 |
*/
|
376 |
private void sendQueueInstruction (String inst) { |
377 |
String packet = ""; |
378 |
packet += ColonetServerInterface.COLONET_QUEUE; |
379 |
packet += " " + inst;
|
380 |
packet += "\n";
|
381 |
sendString(packet); |
382 |
} |
383 |
|
384 |
/**
|
385 |
* Notifies the Colonet server to add a task to the current task queue. The Colonet server holds the canonical
|
386 |
* task queue. Any applet can send tasks to add to the queue. Local copies of the queue in the applet are for
|
387 |
* display purposes only, and are not authoritative when adding tasks. All clients send additions asynchronously,
|
388 |
* and as a result no guarantee is made that a task will be added in the specificed location in the queue or at
|
389 |
* all. If an invalid position is specified, the task will probably not be added to the queue and may cause
|
390 |
* server failure. Due to the asynchronous nature of the queue, we cannot easily account for concurrent
|
391 |
* modification failures on the client side.
|
392 |
*
|
393 |
* @param pos The position in the queue at which we would like the task to be placed. Note that this is not
|
394 |
* guaranteed. Invalid positions may cause the task to be discarded at the server.
|
395 |
* @param data The String containing the command code(s) for the task and any arguments necessary to fully
|
396 |
* define the behavior of the task. This format is currently not specified. In the future, the canonical format
|
397 |
* of the data String will ultimately be defined by the Colonet server.
|
398 |
* @param description A String that contains a description of the task. This will be the message displayed to
|
399 |
* the user when information about the task is requested.
|
400 |
*/
|
401 |
public void sendQueueAdd (int pos, String data, String description) { |
402 |
String packet = ""; |
403 |
packet += ColonetServerInterface.QUEUE_ADD; |
404 |
packet += " " + pos;
|
405 |
packet += " " + data;
|
406 |
packet += " [" + description + "]"; |
407 |
packet += "\n";
|
408 |
sendQueueInstruction(packet); |
409 |
} |
410 |
|
411 |
/**
|
412 |
* Notifies the Colonet server to remove a task from the current task queue. The Colonet server holds the canonical
|
413 |
* task queue. Any applet can remove a task from the queue. Local copies of the queue in the applet are for
|
414 |
* display purposes only, and are not authoritative when removing tasks. All clients remove tasks asynchronously,
|
415 |
* and as a result no guarantee is made that the correct task will actually be removed.
|
416 |
* If an invalid position is specified, the state of the queue is undefined and server failure may result.
|
417 |
* Due to the asynchronous nature of the queue, we cannot easily account for concurrent
|
418 |
* modification failures on the client side.
|
419 |
*
|
420 |
* @param pos The position in the queue at which we would like the task to be removed. Note that this is not
|
421 |
* guaranteed. Invalid positions may result in a corrupted queue.
|
422 |
*/
|
423 |
public void sendQueueRemove (int pos) { |
424 |
String packet = ""; |
425 |
packet += ColonetServerInterface.QUEUE_REMOVE; |
426 |
packet += " " + pos;
|
427 |
packet += "\n";
|
428 |
sendQueueInstruction(packet); |
429 |
} |
430 |
|
431 |
/**
|
432 |
* Notifies the Colonet server to reorder tasks in the current task queue. The Colonet server holds the canonical
|
433 |
* task queue. Any applet can reorder tasks in the queue. Local copies of the queue in the applet are for
|
434 |
* display purposes only, and are not authoritative when reordering tasks. All clients reorder tasks asynchronously,
|
435 |
* and as a result no guarantee is made that the correct tasks will actually be reordered.
|
436 |
* If an invalid position is specified, the state of the queue is undefined and server failure may result.
|
437 |
* Due to the asynchronous nature of the queue, we cannot easily account for concurrent
|
438 |
* modification failures on the client side.
|
439 |
*
|
440 |
* @param pos1 The queue position of a task which we would like to reorder.
|
441 |
* @param pos2 The queue position of a task which we would like to reorder.
|
442 |
*/
|
443 |
public void sendQueueReorder (int pos1, int pos2) { |
444 |
String packet = ""; |
445 |
packet += ColonetServerInterface.QUEUE_REORDER; |
446 |
packet += " " + pos1;
|
447 |
packet += " " + pos2;
|
448 |
packet += "\n";
|
449 |
sendQueueInstruction(packet); |
450 |
} |
451 |
|
452 |
public void sendQueueUpdate () { |
453 |
sendQueueInstruction(ColonetServerInterface.QUEUE_UPDATE); |
454 |
} |
455 |
|
456 |
/**
|
457 |
* Display informational message box on the screen. Used for casual communicaton to the user.
|
458 |
* @param text Text to display
|
459 |
*/
|
460 |
public void msg (String text) { |
461 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.INFORMATION_MESSAGE); |
462 |
} |
463 |
|
464 |
/**
|
465 |
* Display warning message box on the screen. Used for minor alerts or exceptions.
|
466 |
* @param text Text to display
|
467 |
*/
|
468 |
public void warn (String text) { |
469 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.WARNING_MESSAGE); |
470 |
} |
471 |
|
472 |
/**
|
473 |
* Display error message box on the screen. Used for major errors or exceptions in the program.
|
474 |
* @param text Text to display
|
475 |
*/
|
476 |
public void err (String text) { |
477 |
JOptionPane.showMessageDialog(colonet, text, "Colonet", JOptionPane.ERROR_MESSAGE); |
478 |
} |
479 |
|
480 |
|
481 |
/*
|
482 |
* DataListener thread.
|
483 |
*
|
484 |
*/
|
485 |
class DataListener extends Thread { |
486 |
final int DATALISTENER_DELAY = 122; |
487 |
|
488 |
public DataListener () {
|
489 |
super("Colonet DataListener"); |
490 |
} |
491 |
|
492 |
public void run () { |
493 |
String line;
|
494 |
while (true) { |
495 |
try {
|
496 |
line = reader.readLine(); |
497 |
if (line == null) { |
498 |
throw new IOException(); |
499 |
} |
500 |
parseData(line); |
501 |
Thread.sleep(DATALISTENER_DELAY);
|
502 |
} catch (InterruptedException e) { |
503 |
return;
|
504 |
} catch (IOException e) { |
505 |
disconnect(); |
506 |
return;
|
507 |
} |
508 |
} |
509 |
} |
510 |
|
511 |
public void parseData (String line) { |
512 |
// Sensor Matrix
|
513 |
if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
514 |
ColonetServerInterface.REQUEST_BOM_MATRIX)) |
515 |
colonet.parseMatrix(line); |
516 |
// Task Queue
|
517 |
else if (line.startsWith(ColonetServerInterface.COLONET_QUEUE)) |
518 |
colonet.parseQueue(line); |
519 |
// XBee IDs
|
520 |
else if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
521 |
ColonetServerInterface.REQUEST_XBEE_IDS)) |
522 |
colonet.parseXBeeIDs(line); |
523 |
// Battery
|
524 |
else if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
525 |
ColonetServerInterface.BATTERY)) |
526 |
colonet.parseBattery(line); |
527 |
// Robot Positions
|
528 |
else if (line.startsWith(ColonetServerInterface.RESPONSE_TO_CLIENT_REQUEST + " " + |
529 |
ColonetServerInterface.CLIENT_REQUEST_ROBOT_POSITIONS)) |
530 |
colonet.parsePositions(line); |
531 |
// Unknown type
|
532 |
else {
|
533 |
System.out.println("Got unknown data: " + line + "\n"); |
534 |
} |
535 |
} |
536 |
} |
537 |
} |