zeromq / zbroker

Elastic pipes
Mozilla Public License 2.0
50 stars 11 forks source link

Problem: read with no writer does not honor timeout #78

Closed rpedde closed 10 years ago

rpedde commented 10 years ago
  1. open read pipe
  2. read from pipe with a timeout

expect result: timeout after interval with -1/EAGAIN. actual result: blocks indefinitely

This using the new light client.

hintjens commented 10 years ago

It could be a mixup with secs/msecs. I had to change this today. Originally the timeout was in seconds but one of my test cases needed 200msecs timeout.

The clients/zpipes_test_client.c tests this case:

//  Expect timeout error, EAGAIN
bytes = zpipes_client_read (reader, buffer, 6, 100);
assert (bytes == -1);
assert (zpipes_client_error (reader) == EAGAIN);

and that passes.

rpedde commented 10 years ago

agree.