Functional send and receive between client and server