I am making an app where I am setting up a socket with UdpClient. I set the socket to Dgram and udp, I set the socket to reuse address and I bind to my NIC’s IP with the desired port.

However I seem to be unable to receive any data until I view the traffic with wireshark. At that point, i see the traffic spilling on. As soon as I stop capturing in wireshark, the data stops in my app.
How does one have to do with another? And how do I just get my app to just work. Please help!
Code for Reference

Could be that Wireshark sets the network adapter to promiscuous mode.
That’s probably the reason. The packets aren’t sent to your computer but some other MAC address in the local network and enabling Wireshark lets you capture those packets.
This is my first guess too

Dude did you just discover quantum networking? That’s some observer effect stuff.
Something tells me you’re listening to the wrong thing. I’m not familiar with wireshark or networking in general but it sounds to me like your app is picking up on packets sent to it by wireshark.
Schrodinger’s packets lol. Maybe wireshark is de-obfuscating something his os is doing.

For real though, I thought the same thing
There was a regression I found a while ago introduced in the Broadcom drivers for the Raspberry Pi’s Wi-Fi chip that caused it to not respond to ARP when in host mode unless something like tcpdump was running.
Not too familiar with what you are doing, but I do know wireshark creates a loop back adapter. It’s possible you are listening to the wrong network adapter. If you have a way to target a certain one I’d look into that. If not uninstall wireshark and see if you have the same issue.

Note that there isn’t really a loop back adapter on Windows, and wire shark can’t capture traffic between programs on the same machine for that reason.

Hi, I have a lot of experience with network programming. What you’re doing isn’t standard, by far.
The endpoint you’re creating is saying “give me every udp packet received on any interface on any port”.

You want to receive every udp packet ever seen by the entire computer – it doesn’t matter if the packets are over the Loopback Adapter, or are meant to be received by Firefox, or by windows update. You’ll get em all.

What you’re trying to do is only possible if:
your process is run in admin mode, and
you configure for promiscuous mode.
You’re trying to write a packet sniffer.

If this is not what you’re trying to do, then I would reconsider your approach.
ipe_Received isn’t the listener setup, it’s used to store the information who sent the data.

Do you have any good documentation or resources you could recommend that I can look at in order to better my approach?
What’s the value of ipe_mLocalIPAddress?

My NIC’s ip: 192.168.0.25 with the port I’m listening to
Try binding to 0.0.0.0
This may be old advice but i’m fairly certain the best method to capture traffic using wireshark is to use a port in your switch, mirror all traffic to it and then connect that port to a separate nic in the same machine you’re running wireshark. Then monitor/filter the traffic on that nic.
Hope that helps.

Are you using a loopback address (127.0.0.1, localhost, etc) or the real one?
In the example I’m bounded to my NIC’s IP: 192.168.0.25
I am guessing you are using a multicast address? Any chance the address starts with 239. or 224 ?

Check the device(adapter) that your udpclient/server object is attached to, sounds like it’s attached to the Wireshark adapter.
Hope that solves or least helps

source