socket.setSoTimeout(ONE_MINUTE);
outDataStrm = new PrintWriter(socket.getOutputStream(), true);
inDataStrm = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String sentence;
ActiveAircraftMap aircraftMap = ActiveAircraftMap.getInstance();
MessageFormatter formatter = new MessageFormatter();
ADSBMessage msg;
while ((sentence = inDataStrm.readLine()) != null && isEnabled) {
msg = formatter.extractMessage(sentence);
if (msg != null) {
aircraftMap.assignToAircraft(msg);
}
// System.out.println(sentence);
}
System.out.println("Connection Terminated");
outDataStrm.close();