Skip to content

Using java-integration (1.3.0) crashes when trying to send a DONE message to cp-profiler #3

@Genereux-akotenou

Description

@Genereux-akotenou

I'm trying to use cpprofiler to visualize a constraint programming exercise. My solver is in java so I thought I'd use the java integrator.
First I'm trying to draw a static graph in a standalone program that doesn't involve my solver to make sure everything works fine.

The code below crashes suddenly I tried to send only the disconnect that sends a message of type 'DONE' when I debug by converting into the message sent in string (using the method bytesToString)
I have the following table [8, 1]. And I think that's where the problem arises since according to the protocol I had to have just 1 in the first position since the message sent is of the DONE type.

Naturally I first send the size of the message encoded on 4bytes before sending the body of the message by removing the first bytes (which is 8 here). So my message gets through and I get a 'message: done' in the qt console where I run cpprofiler.
...
public class SimpleExample {
public static void main (String args[]) throws IOException {
Connector c = new Connector();
c.connect(6565);

//c.restart("{\"name\": \"minimal example\"}", -1);
//c.createNode(0, -1, -1, 2, Connector.NodeStatus.BRANCH).send();

c.disconnect();

}
}

The same problem arises for the other messages (START, NODE, ...) and when I remove the first bytes it does not work. The encoding of the messages does not seem to follow the protocol. I'm really lost and I ask for your help if I get lost in this matter. Thank you.

Here are some messages I tried to send
DONE -> [8,1]
START -> [8,2,56,255,255,255,255,255,255,255,255,255,1,82,27,123,34,110,97,109,101,34,58,32,34,109,105,110,105,109,97,108,32,101,120,97,109,112,108,101,34,125]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions