TODO: keepalives, align xids