1 subscriber with 2 publishers

49 views
Skip to first unread message

Drew Buckley

unread,
May 11, 2017, 7:44:00 PM5/11/17
to netmq-dev
Hi,

sorry first one was sent before completed.

I have a Subscriber subscribing to all ("") and 2 Publishers sending out this for example:

sendSock.SendMoreFrames(encByte).SendFrame("Info about the individual Publisher");

the encByte is a VP8 encoded screen capture.

on the receiver (subscriber) i can separate each Publisher with the string info sent and decode each Publishers screen capture to render in a ui, however both elements seem to be processing each others frame despite the attached info triggering the render individually.

what i mean is that both publishers frames contain the same byte frame and show 2 screen captures in each.

could the subscriber subscribing to all ("") be mixing them somehow?

appreciate any info on this. scratching my head. thanks

Drew Buckley

unread,
May 14, 2017, 4:07:58 AM5/14/17
to netmq-dev
Some pictures may help to explain what i'm experiencing.

in the first pic is our current MSR.LST.NET Multicast library. Peter (Publisher 1) is on the left showing a real time screen cast. Mary (Publisher 2) is on the right. this is being rendered in our receiver.
the second pic is using NetMQ. you can see that both renders are showing Mary's screen with the black and a photo kind of mixed with Peters windows 10 start bar.

hope that makes it easier to see what i mean. I've also tried separating the 2 publishers multicast ip adresses as well as 2 different topics for the subscriber running 2 subscriber sockets on each different ip address and topic.

using NetMQ i've tried to send only the byte images, same thing. i've tried 2 separate Multicast addresses and ports, same thing. also tried rendering only a seperate image to peter and mary still shows both a mix of peters bytes received as well as mary's.
Screen Share MSR Multicast.jpg
Screen Share NetMQ PGM Multicast.jpg

Drew Buckley

unread,
May 15, 2017, 1:45:15 AM5/15/17
to netmq-dev
Separate Multicast Ip Adresses for each publisher with 2 subscriber sockets each subscribed to each publisher and both seem to be receiving from the publisher it subscribed to as well as the publisher it didn't subscribe to despite 2 different IP Addresses, 2 publishers and 2 subscribers.

Really trying to work this out as it doesn't make sense that 2 connections on 2 different addresses can access each other?

anyone please help. thanks.

Doron Somech

unread,
May 15, 2017, 2:49:41 AM5/15/17
to Drew Buckley, netmq-dev
Any chance you are using the subscriber socket from multiple threads? 
If so, this is might be a  reason everything is mixed. 

--
You received this message because you are subscribed to the Google Groups "netmq-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netmq-dev+unsubscribe@googlegroups.com.
To post to this group, send email to netm...@googlegroups.com.
Visit this group at https://groups.google.com/group/netmq-dev.
For more options, visit https://groups.google.com/d/optout.

Drew Buckley

unread,
May 15, 2017, 4:08:26 AM5/15/17
to netmq-dev
Thanks Doron,

I started out with just one thread to run 1 subscriber receive with 2 publishers sending to the same address with the start of the message stating which one the message was for to render that image on that control for that subscriber and the other for the other subscriber. this was when i first noticed they were both receiving the same images.

i then moved to separating them to 2 subscribers each on their own thread and the same result.

here is the setup for the subscriber:

                    receiverSock1.Options.ReceiveBuffer = 10240;
                   receiverSock1.Options.MulticastHops = 1;
                   receiverSock1.Options.MulticastRate = 400;
                   receiverSock1.Options.MulticastRecoveryInterval = TimeSpan.FromMilliseconds(100);
                   receiverSock1.Options.IPv4Only = true;
                   //receiverSock1.Options.TcpKeepalive = true;
                   receiverSock1.Connect("pgm://239.255.60.101:1000");
                   //receiverSock1.Subscribe("2");

and the setup for the publishers:

                    sendSock1.Options.ReceiveBuffer = 10240;
                    sendSock1.Options.MulticastHops = 1;
                    sendSock1.Options.MulticastRate = 400;
                    sendSock1.Options.MulticastRecoveryInterval = TimeSpan.FromMilliseconds(100);
                    sendSock1.Options.IPv4Only = true;
                   //sendSock1.Options.TcpKeepalive = true;
                    sendSock1.Bind("pgm://239.255.60.101:1000");

each publisher is sending like this:

sendSock.SendMoreFrames("Peter").SendFrame(encodedImage);

and the other:

sendSock.SendMoreFrames("Mary").SendFrame(encodedImage);

the subscriber is seeing that 1 message is for Peter and another is for Mary but the encodedImages attached to each send is being received the same for both of them. i'm using VP8 encoding/decoding and it only sends images that have changed inbetween P frames so if Peter was the last to change on his screen, both see the previous image plus the change is overlayed and visa verca.

hope that helps to find why they are both receiving the same thing?
                   

Doron Somech

unread,
May 15, 2017, 4:28:56 AM5/15/17
to Drew Buckley, netmq-dev
Can you make small code that reproduce the issue? 

Also you can try and encode it into one frame.

--

Drew Buckley

unread,
May 17, 2017, 2:16:26 AM5/17/17
to netmq-dev
Hi Doron,

ok i stripped down my app to have the capture, send and receive. 1 Mary sender/pub and 1 Peter sender/pub.

i'm still getting the same results. i was testing with the sub on an ethernet cable, 1 pub on an ethernet cable and 1 pub on wifi. tried all 3 on cable and same results.

hope you can see something obvious. thanks for checking.

i've uploaded the 3 apps to google drive. let me know if there are any issues.

Publisher1
Publisher2
Subscriber

Doron Somech

unread,
May 19, 2017, 7:29:55 AM5/19/17
to Drew Buckley, netmq-dev
Hey Drew,

So you code seems correct. Might be a problem in the NetMQ pgm implementation.

MY suggestion is to serialize everything into one frame and send it.

--

Drew Buckley

unread,
May 19, 2017, 7:48:25 AM5/19/17
to netmq-dev
Hi Doron,

Thanks for your response.

I've already tried that. i added serialized and added the strings i need to each screen frame and only used the "SendFrame" then BlockCopy at the other end to strip it off and render the frame.

Same result. That plus the fact that 2 completely different Multicast IP Addresses receiving from different Publishers had me stumped.

Did you run the apps i sent? did you see for yourself how it's all getting mixed together?

Appreciate your looking into this. If I can get the PGM to work as expected with normal Multicast this would be a huge improvement on what i'm using already.

Doron Somech

unread,
May 19, 2017, 8:10:11 AM5/19/17
to Drew Buckley, netmq-dev
I'm on linux, so it is hard to test pgm right now.

If you also get same result with one frame I suspect it might be at the application level.

I'm not VP8 expert, but are you sure you can share the Decoder between different streams? I would think each stream need it is own decoder. So it might be first frame arrived take over the decoder and decoder just ignore the rest of frames?





--

Drew Buckley

unread,
May 19, 2017, 8:17:45 AM5/19/17
to netmq-dev
Thanks again for your time.

i started testing with an MPeg4 codec we currently use but starting to swap over to VP8.

good point you raise there though about a separate instance of the codec for each render. I'll give that a try in the morning and report back.

Drew Buckley

unread,
May 19, 2017, 6:32:38 PM5/19/17
to netmq-dev
Thanks again Doron,

Our previous codec must have spawned decoders? With the new VP8 spawning my own seems to work :)

Had to be something simple.

Appreciated and looking forward to properly testing your great library.

Thanks again for your great work :)
Reply all
Reply to author
Forward
0 new messages