Mock UDP socket using object streams