Refactored ydb_socket_input to clean it up. Note that data passed
to these sockets must be tuples in binary format.