We utilise multicasting in our application to efficiently broadcast updates to clients connected to middle-tier(s). I'm continually asked by network engineers about "how our multicasting works" and what multicast protocols it supports. I'm puzzled by these type of questions, in that as far as I'm concerned, our client processes simply join a multicast group by issuing the following commands:
m_sSocket = socket(PF_INET, SOCK_DGRAM, 0);
if (m_sSocket == INVALID_SOCKET)
{
SocketError();
return false;
}
sockaddr_in saServer;
ZeroMemory(&saServer, sizeof(sockaddr_in));
saServer.sin_family = AF_INET;
saServer.sin_addr.s_addr = htonl(INADDR_ANY);
saServer.sin_port = htons(nMulticastPort);
if (bind(m_sSocket, (sockaddr *)&saServer, sizeof(sockaddr_in)) == SOCKET_ERROR)
{
SocketError();
return false;
}
m_ipMulticast.imr_multiaddr.s_addr = inet_addr(tostring(strMulticast).c_str());
m_ipMulticast.imr_interface.s_addr = htons(INADDR_ANY);
// join the multicast group
if (setsockopt(m_sSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(LPCSTR)&m_ipMulticast, sizeof(ip_mreq)) == SOCKET_ERROR)
{
SocketError();
return false;
}
There is no distinction in there as to what multicast protocol it should use. Does anyone have any useful suggestions as to how I respond to these type of questions? At the moment I simply supply the address/port on which we multicast and ask them to open this address/port on their network routers. However this doesn't seem to be enough and they require more information (?)