So I understand what sockets are and what they are for and how to use them. But there is one big '?'. There's such socket type as Datagram and in all references that it has a possibility of losing or receiving data in wrong order. I've seen on one reference that it can even duplicate! That's something I don't get. In computers science I understand that the data is sent from one side of wire and then received at the other side of wire and it continues until it reaches the final computer. So how is it possible that data is lost? Actually after reading all those reference is that data is more likely to be lost and that's why other socket types use one or another protocol to avoid this.
So, again, how does it come that you can lose data?
P.S. I understand the case when the kernel or whatever other part refuses the data (like the port is closed), but let's say all ports are open and ready to be used.
|