set functions for data send/recv