replaced socket rw to send and recv