0
votes

I am not new to netty, even with muticast, but this is the first time I need to receive and send at the same time for a multicast program.

I need to code something that could be compared to mDNS. So every instance of my program need to reply to queries, and as such need to be able to receive query and send a reply (in multicast udp).

But the problem is that I can't send a packet without using connect() on the channel that the bootstrap class gives me, and when I do so, it seems I can't receive anymore.

So is it normal to have to create 2 bootstrap, with the only difference is that for the send one I have to connect the channel, and the receive one I must not to it.

It works, but I would like to know if it the right way to do it.

Thanks.

Note: using Netty v4.1.34.Final on JVM 1.8u181

1

1 Answers

0
votes

You should be able to send by using DatagramPacket(...) and specific the remote address in the constructor.