read_write function

Transfer binary data to and from connections