UdpClient (System.Net.Sockets.UdpClient) is a .NET-Class allowing to send and receive UDP-Traffic.
Questions tagged [udpclient]
575 questions
5
votes
2 answers
Sending UDP packets over the Internet
I'm trying to learn some of the ins and outs of P2P/decentralized networks. My question is the following. Say I have two machines named comp1 and comp2. Now comp1 is setup on my home network behind a router, and comp2 is located in my office at…

cskwrd
- 2,803
- 8
- 38
- 51
5
votes
1 answer
UDP hole-punching: testability on single machine
I'm writing a simple P2P application to test the feasibilty of using UDP hole-punching in a larger project.
I tried my test apps from home yesterday and they worked.
However, I am now at work and the same code no longer does the job. The sender is…

dandan78
- 13,328
- 13
- 64
- 78
5
votes
3 answers
UdpClient -- limited buffersize?
I'm having troubles with UdpClient in C#. I am streaming audio over the internet between two clients.
On my microphone, with a sample rate of 16khz, I send UDP packets with audio with 6400 byte per packet. These never get through, except the last…

KaiserJohaan
- 9,028
- 20
- 112
- 199
5
votes
1 answer
How do I send real-time data over UDP?
I have to send a sequence of video frames over UDP as fast and real-time as possible and while I got the basics working, I am running into all sorts of difficulties. Some of my goals:
Data will normally be sent over dial-up (hence UDP instead of…

Dan C
- 2,236
- 2
- 19
- 30
5
votes
2 answers
UDPClient Multicast receive fails on computer with multiple NICs
I've got a computer with multiple NICs - and UDPClient's send method continually fails. Here's the code:
private static void receiveData()
{
recvSock = new UdpClient(PORT);
…

Dan
- 51
- 1
- 3
5
votes
1 answer
Why can't I get UPnP unicast M-SEARCH to work instead of MultiCast M-SEARCH?
Good morning,
We've decided to use UPnP as much as possible. We are using MultiCast on 239.255.255.250:1900 for our M-SEARCH.
However, we're looking at how to handle when a customer has MultiCast locked down on their network. Looking at the UPnP…

Curtis
- 5,794
- 8
- 50
- 77
5
votes
1 answer
Should a UdpClient be disposed of?
When trying to dispose of a UdpClient, I found that it's impossible. For the following:
UdpClient udpClient = new UdpClient();
udpClient.Dispose();
Visual Studio shows an error:
'System.Net.Sockets.UdpClient.Dispose(bool)' is inaccessible due to
…

ispiro
- 26,556
- 38
- 136
- 291
5
votes
1 answer
Bind multiple listener to the same port
I am using UdpClient class in .net 3.5
I need to bind multiple applications to the same port .
So, if UDP servers broadcast any request - all the applications thats listen on the port can receive the message but the problem is, when I try bind to…

shujaat siddiqui
- 1,527
- 1
- 20
- 41
5
votes
2 answers
How to send a string in a UDP socket in iOS7?
I am trying to send a simple string over UDP in my iOS7 app to a known IP and could not find a simple explanation and sample code on how to do that.
There is plenty out there about TCP but not so much about UDP and it has to be UDP in my case.

Michal Shatz
- 1,416
- 2
- 20
- 31
5
votes
2 answers
use .Net UdpClient in a multithreaded environment
I have an instance of a class (lets call it A) which serves some threads, this instance only sends UDP packets via the UdpClient class.
It initialize the the UdpClient in its constructor and only serves to send the packets.
It looks something…

Tomer Peled
- 3,571
- 5
- 35
- 57
5
votes
1 answer
UDP Hole punching: one Symmitric and another non-symmetric NAT
I am trying to implement P2P with Hole Punching. Here is the flow:
Both Peers(P1,P2) will send 1 packet to server(S).
Server(S) replies back to both telling others IP:PORT
P1 and P2 receive this UDP packet knowing other's external/public…

user739711
- 1,842
- 1
- 25
- 30
5
votes
2 answers
What can cause IP header checksums to not be calculated for UDP datagrams?
I am trying to send UDP datagrams from a UdpClient on Windows XP to a device, but it is not responding. When I look at that traffic in Wireshark, I see that my outbound packets are bad, because all of their IP header checksums are 0x0000.
The…

John
- 230
- 5
- 16
4
votes
1 answer
How to find out which endpoint caused the SocketException, UdpClient
I'm using a UdpClient at the server end and it is sending data to the client end (more than one client).
Suddenly the client stops listening on the udp port and the server gets hit with an SocketException, either when calling endRecieve or…

dpington
- 1,844
- 3
- 17
- 29
4
votes
1 answer
IPFIX data over UDP to C# - can I decode the data?
I have a code sample from the MSDN website to create a UDP listener/client as I am trying to receive IPFIX/Netflow data from a firewall and then work with the data I receive.
The code does work and starts to reveive data but its jargon (see below)…

Jimbo James
- 727
- 2
- 9
- 17
4
votes
4 answers
Can UDP retransmit lost data?
I know the protocol doesn't support this but is it common for clients that require some level of reliability to build into their application a method for requesting retransmission of a packet if found to be corrupt?

edwinNosh
- 389
- 3
- 9
- 16