any Windows networking mavens out there?
-
@mzimmers said in any Windows networking mavens out there?:
But in my instance, I'm only sending one message every 3 seconds (or far less frequently when using the debugger), and I never see any output in Wireshark. So I'm still not sure what the takeaway is.
Something else you could try is to drop the shared flag and the multicast at least for time being and try an ordinary p2p datagram. Other than that nothing else comes to mind.
-
Hey!
You are adding all known addresses to m_socks but I do not see you add it to your packets/sender anywhere?
Also I cannot find any declaration for the addr m_addrBroadcast? -
qha = addr->ip(); only declares one ip? when what you might need to do is iterate over the socket list?
-
@MEMekaniske said in any Windows networking mavens out there?:
Hey!
You are adding all known addresses to m_socks but I do not see you add it to your packets/sender anywhere?
Ladies and gentlemen, we have a winner!
I didn't realize I had to do that. The corrected code is:
for (it = m_socks.begin(); it != m_socks.end(); ++it) { m_datagramOut.setData(msg); m_datagramOut.setSender(it->addr.ip()); m_datagramOut.setDestination(m_addrBroadcast, VOIP_BROADCAST_PORT); rc = it->sockBroadcast->writeDatagram(m_datagramOut);
and it works! (at least on my system)
I can't even hazard a guess as to why the app worked without this added line on some systems.
But...thanks a ton, MEMekaniske.
-
Hey, glad it sends out to everyone now :)
As I could not see the m_addrBroadcast declaration anywhere it's hard to say why it was not using the broadcast addr.Anyways, if this works fine, no need to use more time on it I guess :)
-
@MEMekaniske yes indeed. Here's the assignment you asked about:
m_addrBroadcast.setAddress(QHostAddress::Broadcast);
This is done in the c'tor of the class.
Thanks again.
-
Hey, following that call I get the wrong broadcast addr for my network.
Cannot seem to get Qt to deliver the broadcast addr at all, it just returns the netmask with the last bits flipped and not the gatewayWhen calculating the broadcast addr myself then I get the correct one and it works fine.
Maybe you should set up a script yourself to calculate the broadcast addr for the system and let qt do other things :p -
@MEMekaniske that's strange -- my datagrams are all fine, and according to Wireshark have all the correct addresses. What OS are you running?
-
@mzimmers If i iterate over the interfaces like in your script, then it works with no problem :)
Running on windows :)When using only the QHostAddress::Broadcast I get the wrong broadcast addr. I too think it is strange, but this is no issue for me, as it's always simple to determine the right address by code or manually :) just strange as you say :)
Anways, off to new issues :D