Search code examples
linuxnetworkingudpicmpraw-sockets

Can you miss packets, when socket is currently not receiving?


I got sockets that are listening to ICMP/UDP packets. If the socket receives a packet and the handling of this packet takes too long (code after socket.receive()), could following packets be missed, since I'm currently not at socket.receive() part?


Solution

  • Strictly speaking, yes. The implementation is free to discard packets any place it wishes to. However, it would be a pretty poor implementation if it didn't provide some reasonable amount of buffering, and Linux does.