Allowing empty UDP messages, plus other socket improvements.