try {
while ((line = reader.readLine()) != null) {
eventBus.handleLine(line);
}
} catch (IOException e) {
eventBus.dispatchEvent(new ErrorEvent(3, e, handler.getPowerSocket()));
}
try {
reader.close();
handler.getSocket().close();
} catch (IOException e) {
eventBus.dispatchEvent(new ErrorEvent(6, e, handler.getPowerSocket()));
}
eventBus.dispatchEvent(new DisconnectEvent(handler.getPowerSocket()));
}