Merged _socket_route_data() into its only caller, after untangling its logic.