use of com.sedmelluq.discord.lavaplayer.remote.message.TrackExceptionMessage in project lavaplayer by sedmelluq.
the class RemoteNodeProcessor method handleResponseBody.
private boolean handleResponseBody(InputStream inputStream, TickBuilder tickBuilder) {
CountingInputStream countingStream = new CountingInputStream(inputStream);
DataInputStream input = new DataInputStream(countingStream);
RemoteMessage message;
try {
while ((message = mapper.decode(input)) != null) {
if (message instanceof TrackStartResponseMessage) {
handleTrackStartResponse((TrackStartResponseMessage) message);
} else if (message instanceof TrackFrameDataMessage) {
handleTrackFrameData((TrackFrameDataMessage) message);
} else if (message instanceof TrackExceptionMessage) {
handleTrackException((TrackExceptionMessage) message);
} else if (message instanceof NodeStatisticsMessage) {
handleNodeStatistics((NodeStatisticsMessage) message);
}
}
} catch (InterruptedException interruption) {
log.error("Node {} processing thread was interrupted.", nodeAddress);
Thread.currentThread().interrupt();
return false;
} catch (Throwable e) {
log.error("Error when processing response from node {}.", nodeAddress, e);
ExceptionTools.rethrowErrors(e);
} finally {
tickBuilder.responseSize = countingStream.getCount();
}
return true;
}
Aggregations