Problems with nodejs client

3 posts / 0 new
Last post
Offline
Last seen: 7 years 2 months ago
Joined: 10/25/2017
Posts: 2
Problems with nodejs client

as per this github issue: https://github.com/rticommunity/rticonnextdds-connector/issues/55

I have this code, using the nodejs module:

const rti = require('rticonnextdds-connector');
const dds = new rti.Connector("MyParticipantLibrary::Zero", "c2/DdsC2.xml");
const output = dds.getOutput("MyPublisher::MySquareWriter");

let i = 0;

function broadcast() {
    output.clear_members();
    output.instance.setNumber("x", 1);
    output.instance.setNumber("y", 2);
    output.instance.setNumber("shapesize", 30);
    output.instance.setString("color", "BLUE");
    const s = new Date();
    output.write();
    const e = new Date();
    console.log('dds write:', i++, e.getTime() - s.getTime());
}

for(;;){
    broadcast();
}

After 40 iterations it starts hanging and timing out, as seen in this output:

dds write: 0 1
dds write: 1 0
dds write: 2 0
dds write: 3 0
dds write: 4 1
dds write: 5 0
dds write: 6 0
dds write: 7 0
dds write: 8 0
dds write: 9 0
dds write: 10 0
dds write: 11 1
dds write: 12 0
dds write: 13 0
dds write: 14 0
dds write: 15 0
dds write: 16 0
dds write: 17 0
dds write: 18 0
dds write: 19 0
dds write: 20 0
dds write: 21 1
dds write: 22 0
dds write: 23 0
dds write: 24 0
dds write: 25 0
dds write: 26 1
dds write: 27 0
dds write: 28 0
dds write: 29 0
dds write: 30 0
dds write: 31 0
dds write: 32 0
dds write: 33 0
dds write: 34 0
dds write: 35 0
dds write: 36 0
dds write: 37 0
dds write: 38 0
dds write: 39 0 //the following lines are printed in 5 sec intervals
dds write: 40 5000
dds write: 41 5000
dds write: 42 5000

Am I doing something wrong or is this a bug?
I am running on ubuntu 16...

any ideas?

thanks

gianpiero's picture
Offline
Last seen: 11 months 2 weeks ago
Joined: 06/02/2010
Posts: 177

Hello,

I posted a reply on github. 

Best,
  Gianpiero

Offline
Last seen: 7 years 2 months ago
Joined: 10/25/2017
Posts: 2

Thanks,

Will continue there...