Multicast sockets with Winsock

Started by
1 comment, last by dave 17 years, 1 month ago
I've got a client and server pair of programs communicating such that all the clients recieve and display the message that the multicast server is broadcasting, however i now need to have the client send a message to the multicast server. The socket i have on the client that connects to the multicast socket on the server will not send anything and i can't seem to find anywhere that says whether i need to set a flag or not. Most google results are only transmitting, so far as i can see. If this is not possible, the only viable solution i can see is to open up another UDP socket on the server to be used only for recieving messages from the clients. Any ideas on how i do this? Dave
Advertisement
Quote:Original post by Dave
I've got a client and server pair of programs communicating such that all the clients recieve and display the message that the multicast server is broadcasting, however i now need to have the client send a message to the multicast server. The socket i have on the client that connects to the multicast socket on the server will not send anything and i can't seem to find anywhere that says whether i need to set a flag or not. Most google results are only transmitting, so far as i can see.


What is this beast, the 'multicast socket on the server'?

Multicast is not designed to send to a specific socket on a specific server: that's just a regular 'narrowcast' message. Generally speaking, a server that's sending out a multicast message isn't going to bind to a specific local socket before sending, so it's no good trying to send to a specific socket on the server (except maybe if you're luck the server is listening on the orginating socket that you extract from the UDP header).

Do you know for sure the server is listening for replies?

--smw

Stephen M. Webb
Professional Free Software Developer

Well although i didnt originally state what i suspected, i was correct and have just spoken to the lecturer, he confirmed so. This application pair is such that the server multicasts a message sent to it from a client out to all other clients via the same multicast group. However i was correct in thinking that in order for a client to send a message out to all the other clients it has two options:

1) Send a message to the server so that it can be relayed out, do this via another udp socket.

2) Just multicast it out manually to all other group members which then eliminates any need for the server.

Dave

This topic is closed to new replies.

Advertisement