Fixed issue #40

This commit is contained in:
andrea
2015-06-07 17:57:42 +02:00
parent 3f4a5586de
commit e699d5ff2b
3 changed files with 11 additions and 5 deletions
@@ -667,11 +667,15 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
}
public void onEvent(ValueEvent t, long l, boolean bln) throws Exception {
MessagingEvent evt = t.getEvent();
//It's always of type OutputMessagingEvent
OutputMessagingEvent outEvent = (OutputMessagingEvent) evt;
LOG.debug("Output event, sending {}", outEvent.getMessage());
outEvent.getChannel().write(outEvent.getMessage());
try {
MessagingEvent evt = t.getEvent();
//It's always of type OutputMessagingEvent
OutputMessagingEvent outEvent = (OutputMessagingEvent) evt;
LOG.debug("Output event, sending {}", outEvent.getMessage());
outEvent.getChannel().write(outEvent.getMessage());
} finally {
t.setEvent(null); //free the reference to all Netty stuff
}
}
}
@@ -153,6 +153,7 @@ public class SimpleMessaging implements IMessaging, EventHandler<ValueEvent> {
@Override
public void onEvent(ValueEvent t, long l, boolean bln) throws Exception {
MessagingEvent evt = t.getEvent();
t.setEvent(null); //free the reference to all Netty stuff
LOG.info("onEvent processing messaging event from input ringbuffer {}", evt);
if (evt instanceof StopEvent) {
processStop();