0
votes

I'm creating multicast server/client udp application in C in which server is sending data to multicast group of clients, and if data is not received, clients request for retransmission. I thought to create two sockets on server and client side. On server side one socket for sending multicast and another for receiving replies from clients. And on client side one socket for receiving data and another for reply back to server. What is confusing me is because socket is connected to multicast group...client join on that group with socket. Can I use two sockets and one multicast group or should I create two groups ? What is the most efficient solution? I can not have delays because it will be in real time...do you have some advice ?

Thx

1
i think you should use same socket for both sending message and getting acknowledgement.Heena Goyal
Do you have some arguments why is not logical to use one socket for sending and another for receiving? What about multicast implementation if I decied for two sockets? Do you have experience?user3119422
yes i have hand with many standard protocols like 101 103 modbus. they are standards for communication and there is no second port defined for acknowledgement. and don't tell me then you will use third socket for data transferHeena Goyal
Do you need more threads one server side to process acknowledgement or one thread is enough? Why then some protocols like tftp use different port for sending and receiving? Sorry I'm confused...user3119422
don't be confused there would be two threads one is continuously writing on that socket and one is simultaneously reading the same socket.Heena Goyal

1 Answers

0
votes

On server side one socket for sending multicast and another for receiving replies from clients.

Definitely not.

And on client side one socket for receiving data and another for reply back to server.

Definitely not.

Peers will always want to respond back to the IP:port the request came from. If you add another port you add an endless configuration difficulty. If you only use one port it's easy. There is no performance or architectural reason to use two ports per process for this.