[zeromq-dev] Delayed Reception of messages when using Multicast Method (Using PGM)
Divya Mohan
divya.mohan310 at gmail.com
Fri Feb 8 17:41:09 CET 2013
Hi Steve/Ian,
I am not altering any default PGM properties.
But I am sending 36 bytes of data every 1 sec in a while loop. I am not
seeing any data loss. All the data send is received but with a delay.
Here's the pseudocode:
Process1:
void *context;
void * pub_socket= NULL;
void* sub_socket= NULL;
void send_message()
{
char data[36];
zmq_send(pub_socket,data,36,0);
}
void recv_message()
{
char data[36];
int i=10;
while(i>0) //process 10 messages continously
{ zmq_recv(sub_socket,data,36,ZMQ_DONTWAIT); }
}
main()
{
context = zmq_ctx_new();
pub_socket = zmq_socket(context,ZMQ_PUB);
sub_socket = zmq_socket(context,ZMQ_SUB);
zmq_bind(pub_socket ,"epgm://127.0.0.1;239.192.1.1:5580");
zmq_connect(sub_socket,"epgm://127.0.0.1;239.192.1.1:5580" );
zmq_setsockopt(sub_socket,ZNQ_SUBSCRIBE,0,NULL);
while(1)
{
send_message()
sleep(1);
receive_message();
}
zmq_close(pub_socket);
zmq_close(sub_socket);
zmq_ctx_destroy(context);
}
Process2:
void *context;
void * pub_socket= NULL;
void* sub_socket= NULL;
void send_ack()
{
char data[36];
zmq_send(pub_socket,data,36,0);
}
void recv_message()
{
char data[36];
zmq_recv(sub_socket,data,36,ZMQ_DONTWAIT);
send_ack();
}
main()
{
context = zmq_ctx_new();
pub_socket = zmq_socket(context,ZMQ_PUB);
sub_socket = zmq_socket(context,ZMQ_SUB);
zmq_bind(pub_socket ,"epgm://127.0.0.1;239.192.1.1:5580");
zmq_connect(sub_socket,"epgm://127.0.0.1;239.192.1.1:5580" );
zmq_setsockopt(sub_socket,ZNQ_SUBSCRIBE,0,NULL);
while(1)
{
receive_message();
}
zmq_close(pub_socket);
zmq_close(sub_socket);
zmq_ctx_destroy(context);
}
NOTE: In my actual application I am using the wrapper APIs from my
application which inturn calls the zeromq APIs.
In my application, process1 broadcasts a message. Process2 on receiving
that message broadcasts a reply message.
My observation is that process1 receives its own message almost at the same
speed as it sends (send and receive count are same) but the message from
process2 is received at process1 much later ( eg: if send count is 100
receive count will be around 65)
Thanks,
Divya
On Fri, Feb 8, 2013 at 9:15 PM, Steven McCoy <steven.mccoy at miru.hk> wrote:
> On 8 February 2013 05:50, Divya Mohan <divya.mohan310 at gmail.com> wrote:
>
>> Is it because of PGM or some thing to do with ZeroMQ?
>>
>>
>>
> Typically you will replace a PGM transport with TCP for testing and you
> will most likely find an inconvenient trait of non-congestion-controlled
> reliable multicast.
>
> More details are required though, have you altered the default PGM
> protocol properties? Are you flooding the 0mq socket with data?
>
> --
> Steve-o
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130208/e78eb5a6/attachment.htm>
More information about the zeromq-dev
mailing list