I noticed that if I set a breakpoint in the line below marked "BP>", and do
single step execution of the asserts and zstr_free statements, the next
receive will fail and the test does not proceed beyond that point.

In malamute\src\mlm_client.c, mlm_client_test() has these code lines:
```
    mlm_client_set_producer (writer, "weather");
    mlm_client_set_consumer (reader, "weather", "temp.*");

    mlm_client_sendx (writer, "temp.moscow", "1", NULL);
    mlm_client_sendx (writer, "rain.moscow", "2", NULL);
    mlm_client_sendx (writer, "temp.madrid", "3", NULL);
    mlm_client_sendx (writer, "rain.madrid", "4", NULL);
    mlm_client_sendx (writer, "temp.london", "5", NULL);
    mlm_client_sendx (writer, "rain.london", "6", NULL);

    char *subject, *content;
    mlm_client_recvx (reader, &subject, &content, NULL);
    assert (streq (subject, "temp.moscow"));
    assert (streq (content, "1"));
    assert (streq (mlm_client_command (reader), "STREAM DELIVER"));
    assert (streq (mlm_client_sender (reader), "writer"));
    zstr_free (&subject);
    zstr_free (&content);

BP>    mlm_client_recvx (reader, &subject, &content, NULL);
    assert (streq (subject, "temp.madrid"));
    assert (streq (content, "3"));
    assert (streq (mlm_client_command (reader), "STREAM DELIVER"));
    assert (streq (mlm_client_subject (reader), "temp.madrid"));
    assert (streq (mlm_client_sender (reader), "writer"));
    zstr_free (&subject);
    zstr_free (&content);

// this next recvx never returns... have to ^C to stop the test run...
    rc = mlm_client_recvx(reader, &subject, &content, NULL);
    assert(rc != -1);
    assert(streq(subject, "temp.london"));
    assert(streq(content, "5"));
```

When running the test with verbose and breakpoint enabled I see these
printouts that I do not see when running with no breakpoints.

```
D: 16-04-29 09:20:53   1251:mlm_client                       : connected:
D: 16-04-29 09:20:53   1251:mlm_client                       : connected:
D: 16-04-29 09:20:53   1251:mlm_client                       :     expired
D: 16-04-29 09:20:53   1251:mlm_client                       :     expired
D: 16-04-29 09:20:53   1251:mlm_client                       :         $
server has gone offline
D: 16-04-29 09:20:53   1251:mlm_client                       :         $
server has gone offline
D: 16-04-29 09:20:53   1251:mlm_client                       :         >
disconnected
D: 16-04-29 09:20:53   1251:mlm_client                       :         >
disconnected
D: 16-04-29 09:20:53   1251:mlm_client                       : disconnected:
D: 16-04-29 09:20:53   1251:mlm_client                       :
STREAM_DELIVER
D: 16-04-29 09:20:53   1251:mlm_client                       :         >
disconnected
```

Any ideas why stepping over seven source code lines (no matter how fast I
do it) would expire the server connection?
_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to