} else if (event instanceof LineSentEvent) {
handler.onLineSent((LineSentEvent) event);
} else if (event instanceof LineReceivedEvent) {
handler.onLineReceived((LineReceivedEvent) event);
} else {
handler.onError(new ErrorEvent(0, new InvalidEventException("JPowerSocket found an invalid event when trying to dispatch the event of type: " + event.getClass().getName()), powerSocket));
}
handler.onEvent(event);
}