replace send with write and receive with read