WIP: record layer (send and listen functionality)