简体   繁体   中英

Multicast udp sockets implementation in C

I want to use multicast sockets on server and client side. Server will sending data and client will receiving data. At the same time if data is lost clients will send nack packets to the server and server will receive nack packets. How should I implement this, with one multicast group and one socket-port, with two multicast groups and two sockets-ports?I want that server can send data and also receive nack at the same time,is this possible?

Thank you

You must first decide whether 1) the server will send the missed packets using the initial multicast group; 2) a second multicast group; or 3) a unicast connection to the client. In the first case, an additional socket is not needed by either the server or client. In the second case, both the server and client will need an additional socket. In the third case, the client will need an additional socket and the server will need an additional socket for each client.

The above looks at socket requirements for sending data packets from the server to the clients. For sending NACKS from the client to the server, you'll need to decide whether a client will sends NACKS using 1) the same initial multicast group 2) the secondary multicast group of the second case above; 3) a different multicast group dedicated to NACKS; or 4) a unicast connection to the server. Only in the last two cases will the client need another socket. The server will need an additional socket for the third case and an additional socket for each client for the fourth.

The server can simultaneously multicast packets and respond to missed packets by using multiple threads.

This is an area of very active research (of which I'm a part). Good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM