Minimal serialization for socket messages