Send EndOfStream message at the end of the stream

This commit is contained in:
2013-12-18 13:08:41 +01:00
parent e0ddf5c640
commit dddf9202ff
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
import com.google.common.eventbus.EventBus;
import ch.psi.fda.messages.DataMessage;
import ch.psi.fda.messages.EndOfStreamMessage;
import ch.psi.fda.messages.Metadata;
/**
@@ -128,15 +129,15 @@ public class FdaqService {
bus.post(message);
}
out.close();
in.close();
echoSocket.close();
} catch (IOException e) {
// Ignore potential exceptions if stop was triggered before all messages were retrieved
if (!stopAcquisition) {
throw new RuntimeException(e);
}
} finally {
bus.post(new EndOfStreamMessage());
try {
out.close();
in.close();