add basic logic of send and recv