Hi,
and could you tell us the reason? I have no idea, why the socket should be closed.
It shouldn't! But, I'm guessing Khaled assumed that getting 0 back from a read operation on a UDP socket means somewhat the same as getting 0 back from a read operation on a TCP socket, which is, that the socket EOF'ed and should be closed. That isn't the case (UDP sockets ever reach end-of-file, they're not stream-based) but it's an easy mistake to make. But again: I'm just guessing here.