Younghyo Kim Younghyo Kim - 1 year ago 80
C# Question

What happens if udpclient lost packets in C#

I'm studying computer network nowadays. Now I know a big difference between TCP and UDP is that UDP can lose their packets while communication. I'm wondering how C# react with this lost. For example, one host sends

string to another host. If there were the lost of packet, does the receiving host throw any
or just got like
? (addition) and i want to know some way to enforce for udpclient to lose their packet. then i can do experiment.

fvu fvu
Answer Source

C# couldn't care less - in fact it won't even know a packet was lost. Your code/logic may or may not have issues with that lost packet. That's entirely up to the logic you coded, and has nothing to do with the underlying programming language/runtime system.

I also think you're overthinking/overcomplicating this: losing a packet === not sending one...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download