Skip to content

Commit

Permalink
zsock: fix STREAM test on macOS
Browse files Browse the repository at this point in the history
On macOS, in zsock STREAM test, when STREAM zsock was bound with
`tcp://*:*`, the respective connect to `tcp://127.0.0.1:<port>` was
unable to connect and got stuck indefinitely. Fixed by binding to
`tcp://127.0.0.1:*` instead like in other tests in zsock.
  • Loading branch information
oko256 committed Apr 10, 2024
1 parent 3a38d94 commit e88e211
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/zsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ zsock_vsend (void *self, const char *picture, va_list argptr)
zframe_t *frame = zlistx_pack (list);
zmsg_append (msg, &frame);
}
#endif
#endif
else
if (*picture == 'm') {
zframe_t *frame;
Expand Down Expand Up @@ -1171,7 +1171,7 @@ zsock_vrecv (void *self, const char *picture, va_list argptr)
}
zframe_destroy (&frame);
}
#ifdef CZMQ_BUILD_DRAFT_API
#ifdef CZMQ_BUILD_DRAFT_API
else
if (*picture == 'l') {
zframe_t *frame = zmsg_pop (msg);
Expand Down Expand Up @@ -2205,7 +2205,7 @@ zsock_test (bool verbose)
#ifdef ZMQ_STREAM
zsock_t *streamrecv = zsock_new(ZMQ_STREAM);
assert (streamrecv);
port = zsock_bind(streamrecv, "tcp://*:*");
port = zsock_bind(streamrecv, "tcp://127.0.0.1:*");
assert(port > 0);

zsock_t *streamsender = zsock_new(ZMQ_STREAM);
Expand Down Expand Up @@ -2398,7 +2398,7 @@ zsock_test (bool verbose)
char* message;
message = zstr_recv (gather);
assert (streq(message, "HELLO"));
zstr_free (&message);
zstr_free (&message);

zsock_destroy (&gather);
zsock_destroy (&scatter);
Expand Down

0 comments on commit e88e211

Please sign in to comment.