Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "Removed use of deprecated send/recv methods"

This reverts commit 6daf945.
CZMQ aims to work on libzmq/2.2 as well as 3.2
  • Loading branch information...
commit 72869026f0a87f63afcf7000108c507e93014bb1 1 parent 6daf945
Pieter Hintjens authored
Showing with 7 additions and 7 deletions.
  1. +4 −4 src/zframe.c
  2. +3 −3 src/zstr.c
8 src/zframe.c
View
@@ -134,7 +134,7 @@ zframe_recv (void *zocket)
assert (zocket);
zframe_t *self = zframe_new (NULL, 0);
if (self) {
- if (zmq_msg_recv (&self->zmsg, zocket, 0) < 0) {
+ if (zmq_recvmsg (zocket, &self->zmsg, 0) < 0) {
zframe_destroy (&self);
return NULL; // Interrupted or terminated
}
@@ -154,7 +154,7 @@ zframe_recv_nowait (void *zocket)
assert (zocket);
zframe_t *self = zframe_new (NULL, 0);
if (self) {
- if (zmq_msg_recv (&self->zmsg, zocket, ZMQ_DONTWAIT) < 0) {
+ if (zmq_recvmsg (zocket, &self->zmsg, ZMQ_DONTWAIT) < 0) {
zframe_destroy (&self);
return NULL; // Interrupted or terminated
}
@@ -183,12 +183,12 @@ zframe_send (zframe_t **self_p, void *zocket, int flags)
zmq_msg_init (&copy);
if (zmq_msg_copy (&copy, &self->zmsg))
return -1;
- if (zmq_msg_send (&copy, zocket, snd_flags) == -1)
+ if (zmq_sendmsg (zocket, &copy, snd_flags) == -1)
return -1;
zmq_msg_close (&copy);
}
else {
- if (zmq_msg_send (&self->zmsg, zocket, snd_flags) == -1)
+ if (zmq_sendmsg (zocket, &self->zmsg, snd_flags) == -1)
return -1;
zframe_destroy (self_p);
}
6 src/zstr.c
View
@@ -54,7 +54,7 @@ s_send_string (void *zocket, bool more, const char *format, va_list argptr)
zmq_msg_t message;
zmq_msg_init_size (&message, strlen (string));
memcpy (zmq_msg_data (&message), string, strlen (string));
- int rc = zmq_msg_send (&message, zocket, more? ZMQ_SNDMORE: 0);
+ int rc = zmq_sendmsg (zocket, &message, more? ZMQ_SNDMORE: 0);
zmq_msg_close (&message);
free (string);
@@ -72,7 +72,7 @@ zstr_recv (void *zocket)
assert (zocket);
zmq_msg_t message;
zmq_msg_init (&message);
- if (zmq_msg_recv (&message, zocket, 0) < 0)
+ if (zmq_recvmsg (zocket, &message, 0) < 0)
return NULL;
size_t size = zmq_msg_size (&message);
@@ -96,7 +96,7 @@ zstr_recv_nowait (void *zocket)
assert (zocket);
zmq_msg_t message;
zmq_msg_init (&message);
- if (zmq_msg_recv (&message, zocket, ZMQ_DONTWAIT) < 0)
+ if (zmq_recvmsg (zocket, &message, ZMQ_DONTWAIT) < 0)
return NULL;
size_t size = zmq_msg_size (&message);
Please sign in to comment.
Something went wrong with that request. Please try again.