add data serializing to Socket object