implementing prepareRecvBuf.