Hi,

Here is my situation:
we have a mico-service architect design product, and now we want to perform 
the code coverage for all services and don't expected frequency service 
restart. so we don't use TCPServer and local file mode.

Now we try with TCPClient mode and create a tcp server to collect the dump 
file, after the agent connect to the tcp server, we can use 
RemoteControlWriter.visitDumpCommand to collect dump file from each agent. 

we use the sample executiondataclient code to collect dump file as follow. 
for the first time to trigger dump, the exec file can successful dump out.
final FileOutputStream localFile = new FileOutputStream(DESTFILE);
final ExecutionDataWriter localWriter = new ExecutionDataWriter(
localFile);

// Open a socket to the coverage agent:
final Socket socket = new Socket(InetAddress.getByName(ADDRESS), PORT);
final RemoteControlWriter writer = new RemoteControlWriter(
socket.getOutputStream());
final RemoteControlReader reader = new RemoteControlReader(
socket.getInputStream());
reader.setSessionInfoVisitor(localWriter);
reader.setExecutionDataVisitor(localWriter);

// Send a dump command and read the response:
writer.visitDumpCommand(true, false);
if (!reader.read()) {
throw new IOException("Socket closed unexpectedly.");
}

but if i trigger the dump again, there is a "Invalid execution data file" 
exception throw from here. the type is not 1 but 16, i don't know why the 
second time to trigger file dump, there is no Block_Header return? how to 
resolve?
public boolean read() throws IOException,
IncompatibleExecDataVersionException {
try {
byte type;
do {
type = in.readByte();
if (firstBlock && type != ExecutionDataWriter.BLOCK_HEADER) {
throw new IOException("Invalid execution data file.");
}
firstBlock = false;
} while (readBlock(type));
return true;
} catch (final EOFException e) {
return false;
}
}


Thanks very much.

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/8cfed0ae-5b82-41a3-92a7-820af19091cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to