Send EndOfStream message at the end of the stream
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user