throws Exception {
Object msg = e.getMessage();
if (msg instanceof PacketsMessage) {
PacketsMessage message = (PacketsMessage) msg;
ChannelBuffer content = message.getContent();
BaseClient client = message.getClient();
if (log.isTraceEnabled()) {
log.trace("In message: {} sessionId: {}", new Object[] {content.toString(CharsetUtil.UTF_8), client.getSessionId()});
}
while (content.readable()) {
try {
Packet packet = decoder.decodePackets(content, client.getSessionId());
Namespace ns = namespacesHub.get(packet.getEndpoint());
NamespaceClient nClient = (NamespaceClient) client.getChildClient(ns);
packetListener.onPacket(packet, nClient);
} catch (Exception ex) {
String c = content.toString(CharsetUtil.UTF_8);
log.error("Error during data processing. Client sessionId: " + client.getSessionId() + ", data: " + c, ex);
}
}
} else {
ctx.sendUpstream(e);
}