but it didn't seem like upCASE actually sent information.
I believe he was setting up a UDP socket to listen for broadcasts. Is that correct?
If that is the case how do I use wxSocketClient to broadcast? Is this as simple as calling wxSocketBase::Write() from the wxDatagramSocket instance which was setup to use AnyAddress() ?
Code from the referenced thread.
Code: Select all
wxIPV4address addr;
addr.AnyAddress();
addr.Service(30301);
m_multicastSocket = new wxDatagramSocket(addr,wxSOCKET_REUSEADDR);
if(m_multicastSocket->Ok())
{ ip_mreq mreg;
memset(&mreq,0,sizeof(ip_mreq));
mreq.imr_multiaddr.s_addr = inet_addr(GROUP_DEFAULT);
mreq.imr_interface.s_addr = htons(INADDR_ANY);
m_multicastSocket->SetOption(IPPROTO_IP, IP_ADD_MEMBERSHIP, (char far *)&mreq,sizeof(mreq));
m_multicastSocket->SetNotify(wxSOCKET_INPUT_FLAG);
m_multicastSocket->Notify(true);
m_multicastSocket->SetEventHandler(*this, ID_MULTICAST);
}