send IGMP packets for a user specified group address. As well, it can
send and receive UDP packets for a specified multicast group. I'm using
the Sockets Class methods for sending and receiving packets. One area I'm having problems with is recieving IGMP packets on the Raw IP socket.
Here is the main calls I am using to receive IGMP packets.
Expand|Select|Wrap|Line Numbers
- s = new Socket(AddressFamily::InterNetwork, SocketType::Raw,
- ProtocolType::Igmp);
- s->SetSocketOption(SocketOptionLevel::IP,
- SocketOptionName::MulticastInterface, 0);
- s->Bind(new IPEndPoint(IPAddress::Any,0));
- IPEndPoint* sender = new IPEndPoint(IPAddress->Any, 0);
- EndPoint* tempRemoteEP = __try_cast<EndPoint*>(sender);
- Byte buffer[] = new Byte[1024];
- Console::WriteLine(S"Waiting on socket.");
- s->ReceiveFrom(buffer, 0, 1024, SocketFlags::None, &tempRemoteEP);
messaging, but my test module is not receiving these. I've tried various
other Socket Options, etc. and haven't had any success. I've read some
info on Bind that a 0 causes Bind to generate a enphemoral port number.
Since I'm trying to do Raw IP do I bind or do I need some value other than
0 for bind? I haven't been able to find any examples or info anywhere on
the Web and I've fallin into the mode of just trying various options from
the Socket Class. Kinda like rolling dice. Any one have any experience
in setting up to receive Raw IP with MS VC++?