in reply to "Impossible" socket error return
Looks to me like the client finished sending and disconnected, and you get undef when that happens.